]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/install+setup/install/cdrom.c
Kudzu, ReiserFS, uClibc, gettext und Arbeit am Installer
[people/teissler/ipfire-2.x.git] / src / install+setup / install / cdrom.c
1 /* SmoothWall install program.
2 *
3 * This program is distributed under the terms of the GNU General Public
4 * Licence. See the file COPYING for details.
5 *
6 * (c) Lawrence Manning, 2001
7 * CDROM menu. Get "misc" driver name etc.
8 *
9 */
10
11 #include "install.h"
12
13 extern FILE *flog;
14 extern char *mylog;
15
16 extern char **ctr;
17
18 /* Ejects the CDROM. returns 0 for failure, 1 for success. */
19 int ejectcdrom(char *dev)
20 {
21 int fd;
22
23 if ((fd = open(dev, O_RDONLY|O_NONBLOCK)) == -1)
24 return 0;
25
26 if (ioctl(fd, 0x5309) == -1)
27 {
28 close(fd);
29 return 0;
30 }
31 close(fd);
32
33 return 1;
34 }