summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libbb.h20
-rw-r--r--miscutils/eject.c26
2 files changed, 28 insertions, 18 deletions
diff --git a/include/libbb.h b/include/libbb.h
index d05ac29..8b226c0 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -142,14 +142,18 @@
# include <netinet/in.h>
#else
# include <arpa/inet.h>
-# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
-/* We #define socklen_t *after* includes, otherwise we get
- * typedef redefinition errors from system headers
- * (in case "is it defined already" detection above failed)
- */
-# define socklen_t bb_socklen_t
- typedef unsigned socklen_t;
-# endif
+//This breaks on bionic:
+//# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
+///* We #define socklen_t *after* includes, otherwise we get
+// * typedef redefinition errors from system headers
+// * (in case "is it defined already" detection above failed)
+// */
+//# define socklen_t bb_socklen_t
+// typedef unsigned socklen_t;
+//# endif
+//if this is still needed, add a fix along the lines of
+// ifdef SPECIFIC_BROKEN_LIBC_CHECK / typedef socklen_t / endif
+//in platform.h instead!
#endif
#ifndef HAVE_CLEARENV
# define clearenv() do { if (environ) environ[0] = NULL; } while (0)
diff --git a/miscutils/eject.c b/miscutils/eject.c
index a20e04b..15eaf55 100644
--- a/miscutils/eject.c
+++ b/miscutils/eject.c
@@ -25,23 +25,19 @@
#include <sys/mount.h>
#include "libbb.h"
+#if ENABLE_FEATURE_EJECT_SCSI
/* Must be after libbb.h: they need size_t */
-#include "fix_u32.h"
-#include <scsi/sg.h>
-#include <scsi/scsi.h>
-
-/* 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 <scsi/sg.h>
+# include <scsi/scsi.h>
+#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