blob: 0e85a77c771af45e878e31dc1db8cd6b236d8229 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
Index: sound-juicer-2.10.1/src/sj-util.c
===================================================================
--- sound-juicer-2.10.1.orig/src/sj-util.c
+++ sound-juicer-2.10.1/src/sj-util.c
@@ -157,7 +157,14 @@ tray_is_opened (const char *device)
if (fd < 0) {
return FALSE;
}
-
+
+#ifdef __FreeBSD__
+ status = FALSE;
+ ioctl (fd, CDIOCCLOSE);
+ close (fd);
+
+ return status;
+#else
status = ioctl (fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
if (status < 0) {
close (fd);
@@ -167,6 +174,7 @@ tray_is_opened (const char *device)
close (fd);
return status == CDS_TRAY_OPEN;
+#endif
}
gboolean is_audio_cd (const char *device)
@@ -192,6 +200,7 @@ gboolean is_audio_cd (const char *device
return FALSE;
}
+#ifndef __FreeBSD__
fd = open (device, O_RDONLY | O_NONBLOCK | O_EXCL);
if (fd <0) {
return FALSE;
@@ -206,6 +215,7 @@ gboolean is_audio_cd (const char *device
close (fd);
return status == CDS_AUDIO;
+#endif
}
/* Pass NULL to use g_free */
|