Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/miscutils/eject.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/miscutils/eject.c
r3232 r3621 26 26 #include <sys/mount.h> 27 27 #include "libbb.h" 28 #if ENABLE_FEATURE_EJECT_SCSI 28 29 /* 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 39 34 40 35 #define dev_fd 3 … … 43 38 * refactored it a bit for busybox (ne-bb@nicoerfurth.de) */ 44 39 40 #if ENABLE_FEATURE_EJECT_SCSI 45 41 static void eject_scsi(const char *dev) 46 42 { 47 static const char sg_commands[3][6] = {43 static const char sg_commands[3][6] ALIGN1 = { 48 44 { ALLOW_MEDIUM_REMOVAL, 0, 0, 0, 0, 0 }, 49 45 { START_STOP, 0, 0, 0, 1, 0 }, … … 77 73 ioctl(dev_fd, BLKRRPART); 78 74 } 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 79 85 80 86 #define FLAG_CLOSE 1
Note:
See TracChangeset
for help on using the changeset viewer.