diff options
Diffstat (limited to 'multimedia/libmpeg3/patches/patch-ae')
-rw-r--r-- | multimedia/libmpeg3/patches/patch-ae | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/multimedia/libmpeg3/patches/patch-ae b/multimedia/libmpeg3/patches/patch-ae index 9ee333b088e..106856e6de0 100644 --- a/multimedia/libmpeg3/patches/patch-ae +++ b/multimedia/libmpeg3/patches/patch-ae @@ -1,4 +1,4 @@ -$NetBSD: patch-ae,v 1.5 2005/10/29 01:36:42 grant Exp $ +$NetBSD: patch-ae,v 1.6 2005/12/06 17:47:56 joerg Exp $ --- mpeg3io.c.orig 2001-05-20 13:05:26.000000000 +1000 +++ mpeg3io.c @@ -8,54 +8,54 @@ $NetBSD: patch-ae,v 1.5 2005/10/29 01:36:42 grant Exp $ -#include <mntent.h> -#include <sys/stat.h> -+#ifndef __NetBSD__ -+# include <mntent.h> -+# include <sys/stat.h> -+#else ++#if defined(__NetBSD__) || defined(__DragonFly__) +# include <sys/param.h> +# include <sys/mount.h> + -+# if __NetBSD_Version__ >= 299000900 /* 2.99.9 */ ++# if defined(__NetBSD__) && __NetBSD_Version__ >= 299000900 /* 2.99.9 */ +# define statfs statvfs +# endif + +# include <sys/types.h> +# include <sys/stat.h> ++#else ++# include <mntent.h> ++# include <sys/stat.h> +#endif + #include <stdlib.h> #include <string.h> -@@ -88,16 +101,23 @@ int mpeg3io_read_data(unsigned char *buf +@@ -88,16 +101,25 @@ int mpeg3io_read_data(unsigned char *buf int mpeg3io_device(char *path, char *device) { -+#ifndef __NetBSD__ ++#if defined(__NetBSD__) || defined(__DragonFly__) ++ struct statfs file_st; ++ ++ if (statfs(path, &file_st) < 0) ++#else struct stat file_st, device_st; struct mntent *mnt; FILE *fp; if(stat(path, &file_st) < 0) -+#else -+ struct statfs file_st; -+ -+ if (statfs(path, &file_st) < 0) +#endif { perror("mpeg3io_device"); return 1; } -+#ifndef __NetBSD__ ++#if defined(__NetBSD__) || defined(__DragonFly__) ++ strncpy(device, file_st.f_mntfromname, MPEG3_STRLEN); ++#else fp = setmntent(MOUNTED, "r"); while(fp && (mnt = getmntent(fp))) { -@@ -109,6 +129,9 @@ int mpeg3io_device(char *path, char *dev +@@ -109,6 +131,7 @@ int mpeg3io_device(char *path, char *dev } } endmntent(fp); -+#else -+ strncpy(device, file_st.f_mntfromname, MPEG3_STRLEN); +#endif return 0; |