[pkg-bacula-commits] [bacula] 01/01: updated patch to support kfreebsd, now compiles on stretch/sid

Carsten Leonhardt leo at moszumanska.debian.org
Fri Dec 11 22:25:30 UTC 2015


This is an automated email from the git hooks/post-receive script.

leo pushed a commit to branch experimental
in repository bacula.

commit ec0c438f473d54fb3d9976376d81402d7a62c49d
Author: Carsten Leonhardt <leo at debian.org>
Date:   Fri Dec 11 22:21:09 2015 +0100

    updated patch to support kfreebsd, now compiles on stretch/sid
---
 debian/patches/add-basic-kfreebsd-support.patch | 85 +++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/debian/patches/add-basic-kfreebsd-support.patch b/debian/patches/add-basic-kfreebsd-support.patch
index f642182..f0b5e75 100644
--- a/debian/patches/add-basic-kfreebsd-support.patch
+++ b/debian/patches/add-basic-kfreebsd-support.patch
@@ -74,6 +74,91 @@ Last-Update: 2015-12-08
     || defined(HAVE_OPENBSD_OS)
  
  #include <sys/param.h>
+@@ -336,8 +337,42 @@
+ 
+ /* Read mtab entries  */
+ bool read_mtab(mtab_handler_t *mtab_handler, void *user_ctx)
+-{ 
+-#ifdef HAVE_GETMNTENT
++{
++/* Debian stretch GNU/KFreeBSD has both getmntinfo and getmntent, but
++   the first works better, so ordering is important here */
++#ifdef HAVE_GETMNTINFO
++   struct stat st;
++#if defined(ST_NOWAIT)
++   int flags = ST_NOWAIT;
++#elif defined(MNT_NOWAIT)
++   int flags = MNT_NOWAIT;
++#else
++   int flags = 0;
++#endif
++#if defined(HAVE_NETBSD_OS)
++   struct statvfs *mntinfo;
++#else
++   struct statfs *mntinfo;
++#endif
++   int nument;
++
++   P(mutex);
++   if ((nument = getmntinfo(&mntinfo, flags)) > 0) {
++      while (nument-- > 0) {
++         if (is_rootfs(mntinfo->f_fstypename)) {
++            continue;
++         }
++         if (stat(mntinfo->f_mntonname, &st) < 0) {
++            continue;
++         }
++         mtab_handler(user_ctx, &st, mntinfo->f_mntfromname,
++            mntinfo->f_mntonname, mntinfo->f_fstypename, NULL);
++         mntinfo++;
++      }
++   }
++   V(mutex);
++/* HAVE_GETMNTINFO */
++#elif defined(HAVE_GETMNTENT)
+    FILE *mntfp;
+    struct stat st;
+  
+@@ -389,39 +424,6 @@
+ #endif
+ 
+ #endif /* HAVE_GETMNTENT */
+-
+-#ifdef HAVE_GETMNTINFO
+-   struct stat st;
+-#if defined(ST_NOWAIT)
+-   int flags = ST_NOWAIT;
+-#elif defined(MNT_NOWAIT)
+-   int flags = MNT_NOWAIT;
+-#else
+-   int flags = 0;
+-#endif
+-#if defined(HAVE_NETBSD_OS)
+-   struct statvfs *mntinfo;
+-#else
+-   struct statfs *mntinfo;
+-#endif
+-   int nument;
+-
+-   P(mutex);
+-   if ((nument = getmntinfo(&mntinfo, flags)) > 0) {
+-      while (nument-- > 0) {
+-         if (is_rootfs(mntinfo->f_fstypename)) {
+-            continue;
+-         }
+-         if (stat(mntinfo->f_mntonname, &st) < 0) {
+-            continue;
+-         }
+-         mtab_handler(user_ctx, &st, mntinfo->f_mntfromname,
+-            mntinfo->f_mntonname, mntinfo->f_fstypename, NULL);
+-         mntinfo++;
+-      }
+-   }
+-   V(mutex);
+-#endif /* HAVE_GETMNTINFO */
+    return true;
+ } 
+ 
 --- a/src/version.h
 +++ b/src/version.h
 @@ -95,7 +95,7 @@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git



More information about the pkg-bacula-commits mailing list