pkgsrc-WIP-discuss archive

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

Re: wip/bacula



On Thu, Oct 13, 2005 at 05:45:44PM +0200, Florian Heigl wrote:
> the first error is related to NetBSD's statvfs, and was already 
> fixed by the bacula people in march.
> See: 
>  "15Mar05 1.36.2-netbsd.patch
>   This patch corrects a compile problem because of no statfs()
>   on NetBSD. The patch was submitted by kardel with bug 258."

This patch made it work on 3.x and -current, but broke it for 2.x.  The
proper way is to add an autoconf check for <sys/statvfs.h>, and to #ifdef
the code accordingly.  I have submitted the folowing diff to pkgsrc: 

===>
--- autoconf/configure.in.orig  2005-10-14 10:02:10.000000000 +0200
+++ autoconf/configure.in       2005-10-14 10:05:03.000000000 +0200
@@ -1275,6 +1275,8 @@
 fi
 AC_MSG_RESULT($fstype)
 
+AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if 
your system have the sys/statvfs.h header file])] , )
+
 dnl# --------------------------------------------------------------------------
 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
 dnl# --------------------------------------------------------------------------
--- autoconf/config.h.in.orig   2005-10-14 10:02:18.000000000 +0200
+++ autoconf/config.h.in        2005-10-13 18:01:12.000000000 +0200
@@ -97,6 +97,9 @@
    very expensive.  */
 #undef CACHE_IDS
 
+/* Define if you have the <sys/statvfs.h> header file */
+#undef HAVE_SYS_STATVFS_H
+
 /* Define to use SVR4 statvfs to get filesystem type.  */
 #undef FSTYPE_STATVFS
--- src/findlib/fstype.c.orig   2005-04-05 19:23:56.000000000 +0200
+++ src/findlib/fstype.c
@@ -80,6 +80,12 @@ bool fstype(const char *fname, char *fs,
 #include <sys/param.h>
 #include <sys/mount.h>
 
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#else
+#define statvfs statfs
+#endif
+
 bool fstype(const char *fname, char *fs, int fslen)
 {
    struct statvfs st;
<===

        Geert


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss



Home | Main Index | Thread Index | Old Index