]>
Commit | Line | Data |
---|---|---|
d6aaa55d MT |
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 | * $Id: cdrom.c,v 1.6.2.1 2004/04/14 22:05:39 gespinasse Exp $ | |
10 | * | |
11 | */ | |
12 | ||
13 | #include "install.h" | |
14 | ||
15 | extern FILE *flog; | |
16 | extern char *mylog; | |
17 | ||
18 | extern char **ctr; | |
19 | ||
20 | /* Ejects the CDROM. returns 0 for failure, 1 for success. */ | |
21 | int ejectcdrom(char *dev) | |
22 | { | |
23 | int fd; | |
24 | ||
25 | if ((fd = open(dev, O_RDONLY|O_NONBLOCK)) == -1) | |
26 | return 0; | |
27 | ||
28 | if (ioctl(fd, CDROMEJECT) == -1) | |
29 | { | |
30 | close(fd); | |
31 | return 0; | |
32 | } | |
33 | close(fd); | |
34 | ||
35 | return 1; | |
36 | } |