mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
$NetBSD: patch-aa,v 1.3 2012/08/17 14:10:31 marino Exp $
|
|
|
|
--- src/mp3fs.c.orig 2008-12-14 06:17:35.000000000 +0100
|
|
+++ src/mp3fs.c
|
|
@@ -30,7 +30,11 @@
|
|
#include <fcntl.h>
|
|
#include <dirent.h>
|
|
#include <errno.h>
|
|
+#if defined (__NetBSD__) || defined (__DragonFly__)
|
|
+#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) {
|
|
+#if defined (__NetBSD__) || defined (__DragonFly__)
|
|
+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));
|
|
|
|
+#if defined (__NetBSD__) || defined (__DragonFly__)
|
|
+ res = statvfs(name, stbuf);
|
|
+#else
|
|
res = statfs(name, stbuf);
|
|
+#endif
|
|
if(res == -1)
|
|
return -errno;
|
|
|
|
@@ -252,7 +265,7 @@ int main(int argc, char *argv[]) {
|
|
basepath = argv[1];
|
|
bitrate = 0;
|
|
|
|
- rate = strchr(basepath, ',');
|
|
+ rate = strrchr(basepath, ',');
|
|
if(rate) {
|
|
rate[0] = '\0';
|
|
bitrate = atoi(rate + 1);
|