-/* SmoothWall install program.\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence. See the file COPYING for details.\r
- *\r
- * (c) Lawrence Manning, 2001\r
- * CDROM menu. Get "misc" driver name etc. \r
- *\r
- * $Id: cdrom.c,v 1.6.2.1 2004/04/14 22:05:39 gespinasse Exp $\r
- *\r
- */\r
-\r
-#include "install.h"\r
-\r
-extern FILE *flog;\r
-extern char *mylog;\r
-\r
-extern char **ctr;\r
-\r
-/* Ejects the CDROM. returns 0 for failure, 1 for success. */\r
-int ejectcdrom(char *dev)\r
-{\r
- int fd;\r
-\r
- if ((fd = open(dev, O_RDONLY|O_NONBLOCK)) == -1)\r
- return 0;\r
- \r
- if (ioctl(fd, CDROMEJECT) == -1)\r
- {\r
- close(fd);\r
- return 0;\r
- }\r
- close(fd);\r
- \r
- return 1;\r
-}\r
+/* SmoothWall install program.
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence. See the file COPYING for details.
+ *
+ * (c) Lawrence Manning, 2001
+ * CDROM menu. Get "misc" driver name etc.
+ *
+ */
+
+#include "install.h"
+
+extern FILE *flog;
+extern char *mylog;
+
+extern char **ctr;
+
+/* Ejects the CDROM. returns 0 for failure, 1 for success. */
+int ejectcdrom(char *dev)
+{
+ int fd;
+
+ if ((fd = open(dev, O_RDONLY|O_NONBLOCK)) == -1)
+ return 0;
+
+ if (ioctl(fd, 0x5309) == -1)
+ {
+ close(fd);
+ return 0;
+ }
+ close(fd);
+
+ return 1;
+}