pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/libmpeg3 Use statfs on DragonFly as well. T...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3797c16ae0ed
branches:  trunk
changeset: 504192:3797c16ae0ed
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Dec 06 17:47:56 2005 +0000

description:
Use statfs on DragonFly as well. To make the code more readable, restore
natural order of checking for features instead of the reverse.

diffstat:

 multimedia/libmpeg3/distinfo         |   4 ++--
 multimedia/libmpeg3/patches/patch-ae |  32 ++++++++++++++++----------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diffs (97 lines):

diff -r 249ea880a9ba -r 3797c16ae0ed multimedia/libmpeg3/distinfo
--- a/multimedia/libmpeg3/distinfo      Tue Dec 06 17:37:06 2005 +0000
+++ b/multimedia/libmpeg3/distinfo      Tue Dec 06 17:47:56 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2005/10/29 01:43:18 grant Exp $
+$NetBSD: distinfo,v 1.8 2005/12/06 17:47:56 joerg Exp $
 
 SHA1 (libmpeg3-1.3.tar.gz) = e7e8b03ab45d5593558b0d19e31f0694cfdfa2b5
 RMD160 (libmpeg3-1.3.tar.gz) = b1751f681d26758873746aa38368150eb0a4bafd
@@ -7,7 +7,7 @@
 SHA1 (patch-ab) = 3223b9f7d81dd73eec6767f9e1bb2cb26b4bcd80
 SHA1 (patch-ac) = 68576efb30a0d6f4cfe23fd543a04c4f3ada8936
 SHA1 (patch-ad) = 86edf9af264370bf89050b02e956b5bacc86881e
-SHA1 (patch-ae) = 411443571371b2f964ab6408ee5be217f8ca7896
+SHA1 (patch-ae) = 5418e29f4f5c30f235cfb075d99c0022d0ad2394
 SHA1 (patch-af) = 7e62a236ee0a7398c1b1a3e994261ebb9be50bae
 SHA1 (patch-ag) = bf321ac689b82889ca1a2bb8a96cb6e387280f32
 SHA1 (patch-ah) = 58ffda3df9be3b089de362451ddf249a74fac5be
diff -r 249ea880a9ba -r 3797c16ae0ed multimedia/libmpeg3/patches/patch-ae
--- a/multimedia/libmpeg3/patches/patch-ae      Tue Dec 06 17:37:06 2005 +0000
+++ b/multimedia/libmpeg3/patches/patch-ae      Tue Dec 06 17:47:56 2005 +0000
@@ -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 @@
  
 -#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;



Home | Main Index | Thread Index | Old Index