summaryrefslogtreecommitdiff
path: root/filesystems/fuse-mp3fs/patches/patch-aa
blob: 3877d098a1f8211b3c541cd2a8a87b7878ffaab6 (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-aa,v 1.1.1.1 2009/07/16 14:54:02 wiz Exp $

--- src/mp3fs.c.orig	2008-12-14 05:17:35.000000000 +0000
+++ src/mp3fs.c
@@ -30,7 +30,11 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <errno.h>
+#ifdef __NetBSD__
+#include <sys/statvfs.h>
+#else
 #include <sys/statfs.h>
+#endif
 
 #include "transcode.h"
 #include "talloc.h"
@@ -195,7 +199,12 @@ static int mp3fs_read(const char *path, 
   return f->Read(f, buf, offset, size);
 }
 
-static int mp3fs_statfs(const char *path, struct statfs *stbuf) {
+#ifdef __NetBSD__
+static int mp3fs_statfs(const char *path, struct statvfs *stbuf)
+#else
+static int mp3fs_statfs(const char *path, struct statfs *stbuf)
+#endif
+{
   int res;
   char name[256];
 
@@ -204,7 +213,11 @@ static int mp3fs_statfs(const char *path
   strncpy(name, basepath, sizeof(name));
   strncat(name, path, sizeof(name) - strlen(name));
 
+#ifdef __NetBSD__
+  res = statvfs(name, stbuf);
+#else
   res = statfs(name, stbuf);
+#endif
   if(res == -1)
     return -errno;