* Copyright (C) 2004 Peter Willis <psyphreak@phreaker.net>
* Copyright (C) 2005 Tito Ragusa <farmatito@tiscali.it>
*
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
/*
* Most of the dirty work blatantly ripped off from cat.c =)
*/
+//usage:#define eject_trivial_usage
+//usage: "[-t] [-T] [DEVICE]"
+//usage:#define eject_full_usage "\n\n"
+//usage: "Eject DEVICE or default /dev/cdrom\n"
+//usage: "\nOptions:"
+//usage: IF_FEATURE_EJECT_SCSI(
+//usage: "\n -s SCSI device"
+//usage: )
+//usage: "\n -t Close tray"
+//usage: "\n -T Open/close tray (toggle)"
+
#include <sys/mount.h>
#include "libbb.h"
/* Must be after libbb.h: they need size_t */
+#include "fix_u32.h"
#include <scsi/sg.h>
#include <scsi/scsi.h>
int cmd = CDROMEJECT;
if (flags & FLAG_CLOSE
- || (flags & FLAG_SMART && ioctl(dev_fd, CDROM_DRIVE_STATUS) == CDS_TRAY_OPEN)
+ || ((flags & FLAG_SMART) && ioctl(dev_fd, CDROM_DRIVE_STATUS) == CDS_TRAY_OPEN)
) {
cmd = CDROMCLOSETRAY;
}