]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
eject: support CDIOCEJECT ioctl
authorKarel Zak <kzak@redhat.com>
Tue, 27 Mar 2012 15:53:00 +0000 (17:53 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Mar 2012 15:53:00 +0000 (17:53 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/eject.c

index acea2a295c2f38c1f247059088132c94938325f3..402dfe4a235a07efea6e4c8810071cb9c57c72c2 100644 (file)
@@ -527,7 +527,13 @@ static void list_speeds(const char *name, int fd)
  */
 static int eject_cdrom(int fd)
 {
+#if defined(CDROMEJECT)
        return ioctl(fd, CDROMEJECT) == 0;
+#elif defined(CDIOCEJECT)
+       return ioctl(fd, CDIOCEJECT) == 0;
+#else
+       warnx(_("CD-ROM eject unsupported"));
+#endif
 }
 
 /*