summaryrefslogtreecommitdiff
path: root/multimedia/kdemultimedia3/patches/patch-ad
blob: 8530589f698867b0163fd984b687aef6a44cabb4 (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
$NetBSD: patch-ad,v 1.1 2004/05/04 11:30:17 mrg Exp $

--- kscd/libwm/plat_freebsd.c.orig	2003-05-05 22:19:39.000000000 +1000
+++ kscd/libwm/plat_freebsd.c	2004-05-04 19:17:17.000000000 +1000
@@ -380,6 +380,14 @@
   return (ioctl(d->fd, CDIOCSTOP));
 } /* gen_stop() */
 
+/* XXX */
+#ifdef __NetBSD__
+# include <sys/param.h>
+# if __NetBSD_Version__ >= 200040000	 /* 2.0D */
+#  define HAVE_SYS_STATVFS_H 1
+# endif
+#endif
+
 /*----------------------------------------*
  * Eject the current CD, if there is one.
  *----------------------------------------*/
@@ -388,14 +396,22 @@
 {
   /* On some systems, we can check to see if the CD is mounted. */
   struct stat	stbuf;
+#ifdef HAVE_SYS_STATVFS_H
+  struct statvfs	buf;
+#else
   struct statfs	buf;
+#endif
   int rval;
   
   if (fstat(d->fd, &stbuf) != 0)
     return (-2);
   
   /* Is this a mounted filesystem? */
+#ifdef HAVE_SYS_STATVFS_H
+  if (fstatvfs(stbuf.st_rdev, &buf) == 0)
+#else
   if (fstatfs(stbuf.st_rdev, &buf) == 0)
+#endif
     return (-3);
   
   rval = ioctl(d->fd, CDIOCALLOW);