mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-02 08:12:54 +02:00
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
36
src/install+setup/install/cdrom.c
Normal file
36
src/install+setup/install/cdrom.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/* 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.
|
||||
*
|
||||
* $Id: cdrom.c,v 1.6.2.1 2004/04/14 22:05:39 gespinasse Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#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, CDROMEJECT) == -1)
|
||||
{
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user