mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 10:52:57 +02:00
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@346 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
35 lines
574 B
C
35 lines
574 B
C
/* 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;
|
|
}
|