Link Here
|
1 |
--- src/lineakd.c.orig Fri Sep 6 02:50:29 2002 |
|
|
2 |
+++ src/lineakd.c Sat May 24 18:01:00 2003 |
3 |
@@ -57,18 +57,19 @@ |
4 |
#endif |
5 |
#include <fcntl.h> |
6 |
#include <sys/ioctl.h> |
7 |
-#include <linux/cdrom.h> /* linux specific?!! */ |
8 |
|
9 |
extern int mkdir(); /* in linux/fs.h ... other platforms!? */ |
10 |
|
11 |
#if defined (__FreeBSD__) |
12 |
-# include <machine/soundcard.h> |
13 |
+# include <sys/soundcard.h> |
14 |
+# include <sys/cdio.h> |
15 |
#else |
16 |
# if defined (__NetBSD__) || defined (__OpenBSD__) |
17 |
# include <soundcard.h> /* OSS emulation */ |
18 |
# undef ioctl |
19 |
# else |
20 |
/* BSDI, Linux, Solaris */ |
21 |
+# include <linux/cdrom.h> /* linux specific?!! */ |
22 |
# include <sys/soundcard.h> |
23 |
# endif |
24 |
#endif |
25 |
@@ -100,7 +101,7 @@ |
26 |
signal(SIGABRT, signalexit); |
27 |
signal(SIGINT, signalexit); |
28 |
/* and one so we won't have to wait() for child processes ;) */ |
29 |
- signal(SIGCLD, SIG_IGN); |
30 |
+ signal(SIGCHLD, SIG_IGN); |
31 |
/* and for a rehash when we catch SIGHUP */ |
32 |
signal(SIGHUP,signalHUP); |
33 |
|
34 |
@@ -598,12 +599,12 @@ |
35 |
/* try to open the device .. */ |
36 |
if ( (fp = open(cdromdev, O_RDONLY | O_NONBLOCK)) != -1 ) { |
37 |
/* tell the drive to diable auto-eject */ |
38 |
- if ( (ioctl(fp, CDROMEJECT_SW, 0)) == -1 ) |
39 |
- printf("... oops! error during CD-ROM init\n"); |
40 |
- close(fp); |
41 |
- } else { |
42 |
+ if ( (ioctl(fp, CDIOCPREVENT)) == -1 ) |
43 |
+ printf("... oops! error during CD-ROM init\n"); |
44 |
+ close(fp); |
45 |
+ } else { |
46 |
printf("... oops! unable to open the CD-ROM device \"%s\" (CD-ROM init)\n",cdromdev); |
47 |
- } |
48 |
+ } |
49 |
} else { |
50 |
printf("no CD-ROM device configured! (CD-ROM init)\n"); |
51 |
} |
52 |
@@ -618,7 +619,7 @@ |
53 |
if ( (fp = open(cdromdev, O_RDONLY | O_NONBLOCK)) != -1 ) { |
54 |
if (!cdromstatus) { /* assumed closed */ |
55 |
/* enable the drives software eject */ |
56 |
- if ( (ioctl(fp, CDROMEJECT_SW, 1)) == -1 ) |
57 |
+ if ( (ioctl(fp, CDIOCALLOW)) == -1 ) |
58 |
printf("... oops! error enabling CD-ROM SW eject\n"); |
59 |
/* eject the cdrom tray */ |
60 |
if (verbosemode) printf("... ejecting the CD-ROM tray\n"); |
61 |
@@ -628,7 +629,7 @@ |
62 |
cdromstatus = !cdromstatus; |
63 |
} else { /* assumed open */ |
64 |
/* disable the drives software eject again.. */ |
65 |
- if ( (ioctl(fp, CDROMEJECT_SW, 0)) == -1 ) |
66 |
+ if ( (ioctl(fp, CDIOCPREVENT)) == -1 ) |
67 |
printf("... oops! error disabling CD-ROM SW eject\n"); |
68 |
/* close the cdrom tray */ |
69 |
if (verbosemode) printf("... closing the CD-ROM tray\n"); |