]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/1.36.2/1.36.2-netbsd.patch
Commit NULL vol name patch
[bacula/bacula] / bacula / patches / 1.36.2 / 1.36.2-netbsd.patch
1
2  This patch corrects a compile problem because of no statfs() 
3  on NetBSD. The patch was submitted by kardel with bug 258.
4
5  Apply the patch to version 1.36.2 with:
6
7  cd <bacula>
8  patch -p0 <1.36.2-netbsd.patch
9  make
10  ...
11
12 Index: src/findlib/fstype.c
13 ===================================================================
14 RCS file: /cvsroot/bacula/bacula/src/findlib/fstype.c,v
15 retrieving revision 1.7.2.2
16 diff -u -r1.7.2.2 fstype.c
17 --- src/findlib/fstype.c        25 Feb 2005 09:47:06 -0000      1.7.2.2
18 +++ src/findlib/fstype.c        15 Mar 2005 14:01:44 -0000
19 @@ -61,7 +61,6 @@
20   */
21  #if defined(HAVE_DARWIN_OS) \
22     || defined(HAVE_FREEBSD_OS ) \
23 -   || defined(HAVE_NETBSD_OS) \
24     || defined(HAVE_OPENBSD_OS)
25  
26  #include <sys/param.h>
27 @@ -77,7 +76,20 @@
28     Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
29     return false;
30  }
31 +#elif defined(HAVE_NETBSD_OS)
32 +#include <sys/param.h>
33 +#include <sys/mount.h>
34  
35 +bool fstype(const char *fname, char *fs, int fslen)
36 +{
37 +   struct statvfs st;
38 +   if (statvfs(fname, &st) == 0) {
39 +      bstrncpy(fs, st.f_fstypename, fslen);
40 +      return true;
41 +   }
42 +   Dmsg1(50, "statfs() failed for \"%s\"\n", fname);
43 +   return false;
44 +}
45  #elif defined(HAVE_HPUX_OS) \
46     || defined(HAVE_IRIX_OS)
47