Subject: Re: pkg/31570: sysutils/bacula update to 1.36.3
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Geert Hendrickx <ghen@telenet.be>
List: pkgsrc-bugs
Date: 10/13/2005 08:14:01
The following reply was made to PR pkg/31570; it has been noted by GNATS.

From: Geert Hendrickx <ghen@telenet.be>
To: Thomas Klausner <wiz@NetBSD.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: pkg/31570: sysutils/bacula update to 1.36.3
Date: Thu, 13 Oct 2005 10:09:00 +0200

 On Wed, Oct 12, 2005 at 09:39:03PM +0200, Thomas Klausner wrote:
 > On Wed, Oct 12, 2005 at 07:30:00PM +0000, Geert Hendrickx wrote:
 > > One patch was added (patch-ag), because this version uses statvfs(2),
 > > which NetBSD 2.0.x doesn't have.  Simply replacing it with statfs(2)
 > > works nicely.  
 > 
 > But, sadly, is the wrong solution, since this will break the build on
 > 3.x. It should be a configure test and an appropriate #ifdef in the
 > code... Does the bacula configure script already check for it?  If not,
 > plan b (actually, a hack) is to add #ifdefs for older NetBSD versions
 > which only support statfs; see for example
 > sysutils/coreutils/patches/patch-ab.
 
 No, the configure script doesn't test for it.  But your hack worked (I
 tested on both 2.x and 3.x this time).  I wanted to do it this way first:
 http://sprg.ssl.berkeley.edu/~fastops/ITOS/portable/statfs_vs_statvfs.html
 but NetBSD doesn't have such defines.  Anyway, here's a new patch-ag:
 
 ===>
 $NetBSD$
 
 --- src/findlib/fstype.c.orig	2005-04-05 19:23:56.000000000 +0200
 +++ src/findlib/fstype.c
 @@ -80,10 +80,14 @@ bool fstype(const char *fname, char *fs,
  #include <sys/param.h>
  #include <sys/mount.h>
  
 +#if (__NetBSD_Version__ > 299000000)
 +#define statfs statvfs
 +#endif
 +
  bool fstype(const char *fname, char *fs, int fslen)
  {
 -   struct statvfs st;
 -   if (statvfs(fname, &st) == 0) {
 +   struct statfs st;
 +   if (statfs(fname, &st) == 0) {
        bstrncpy(fs, st.f_fstypename, fslen);
        return true;
     }
 <===
 
 	Geert