$NetBSD: patch-aa,v 1.5 2014/11/26 22:31:41 wiz Exp $ --- src/mp3fs.c.orig 2008-12-14 06:17:35.000000000 +0100 +++ src/mp3fs.c @@ -30,7 +30,11 @@ #include #include #include +#if defined (__NetBSD__) || defined (__DragonFly__) +#include +#else #include +#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);