From dbb58a3879c2daa3e286a8cd9da7935e264f3072 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 14 Mar 2016 18:23:33 +0100 Subject: fixes for problems found by bionic build Signed-off-by: Denys Vlasenko --- miscutils/eject.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'miscutils') diff --git a/miscutils/eject.c b/miscutils/eject.c index a20e04b7f..15eaf556d 100644 --- a/miscutils/eject.c +++ b/miscutils/eject.c @@ -25,23 +25,19 @@ #include #include "libbb.h" +#if ENABLE_FEATURE_EJECT_SCSI /* Must be after libbb.h: they need size_t */ -#include "fix_u32.h" -#include -#include - -/* various defines swiped from linux/cdrom.h */ -#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ -#define CDROMEJECT 0x5309 /* Ejects the cdrom media */ -#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */ -/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */ -#define CDS_TRAY_OPEN 2 +# include "fix_u32.h" +# include +# include +#endif #define dev_fd 3 /* Code taken from the original eject (http://eject.sourceforge.net/), * refactored it a bit for busybox (ne-bb@nicoerfurth.de) */ +#if ENABLE_FEATURE_EJECT_SCSI static void eject_scsi(const char *dev) { static const char sg_commands[3][6] = { @@ -76,6 +72,16 @@ static void eject_scsi(const char *dev) /* force kernel to reread partition table when new disc is inserted */ ioctl(dev_fd, BLKRRPART); } +#else +# define eject_scsi() ((void)0) +#endif + +/* various defines swiped from linux/cdrom.h */ +#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ +#define CDROMEJECT 0x5309 /* Ejects the cdrom media */ +#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */ +/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */ +#define CDS_TRAY_OPEN 2 #define FLAG_CLOSE 1 #define FLAG_SMART 2 -- cgit v1.2.3