Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/miscutils/eject.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/miscutils/eject.c

    r3232 r3621  
    2626#include <sys/mount.h>
    2727#include "libbb.h"
     28#if ENABLE_FEATURE_EJECT_SCSI
    2829/* Must be after libbb.h: they need size_t */
    29 #include "fix_u32.h"
    30 #include <scsi/sg.h>
    31 #include <scsi/scsi.h>
    32 
    33 /* various defines swiped from linux/cdrom.h */
    34 #define CDROMCLOSETRAY            0x5319  /* pendant of CDROMEJECT  */
    35 #define CDROMEJECT                0x5309  /* Ejects the cdrom media */
    36 #define CDROM_DRIVE_STATUS        0x5326  /* Get tray position, etc. */
    37 /* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
    38 #define CDS_TRAY_OPEN        2
     30# include "fix_u32.h"
     31# include <scsi/sg.h>
     32# include <scsi/scsi.h>
     33#endif
    3934
    4035#define dev_fd 3
     
    4338 * refactored it a bit for busybox (ne-bb@nicoerfurth.de) */
    4439
     40#if ENABLE_FEATURE_EJECT_SCSI
    4541static void eject_scsi(const char *dev)
    4642{
    47     static const char sg_commands[3][6] = {
     43    static const char sg_commands[3][6] ALIGN1 = {
    4844        { ALLOW_MEDIUM_REMOVAL, 0, 0, 0, 0, 0 },
    4945        { START_STOP, 0, 0, 0, 1, 0 },
     
    7773    ioctl(dev_fd, BLKRRPART);
    7874}
     75#else
     76# define eject_scsi(dev) ((void)0)
     77#endif
     78
     79/* various defines swiped from linux/cdrom.h */
     80#define CDROMCLOSETRAY            0x5319  /* pendant of CDROMEJECT  */
     81#define CDROMEJECT                0x5309  /* Ejects the cdrom media */
     82#define CDROM_DRIVE_STATUS        0x5326  /* Get tray position, etc. */
     83/* drive status possibilities returned by CDROM_DRIVE_STATUS ioctl */
     84#define CDS_TRAY_OPEN        2
    7985
    8086#define FLAG_CLOSE  1
Note: See TracChangeset for help on using the changeset viewer.