GNU file utilities
[gnulib.git] / lib / mountlist.c
index d68cf8d..b2ed440 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#if defined (CONFIG_BROKETS)
-/* We use <config.h> instead of "config.h" so that a compilation
-   using -I. -I will use ./config.h rather than /config.h
-   (which it would do because it found this file in ).  */
 #include <config.h>
-#else
-#include "config.h"
-#endif
 #endif
 
 #include <stdio.h>
@@ -47,6 +40,10 @@ char *xrealloc ();
 char *xstrdup ();
 void error ();
 
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
 #if defined (MOUNTED_GETFSSTAT)        /* __alpha running OSF_1 */
 #  include <sys/mount.h>
 #  include <sys/fs_types.h>
@@ -69,7 +66,6 @@ void error ();
 #endif
 
 #ifdef MOUNTED_GETMNT          /* Ultrix.  */
-#include <sys/param.h>
 #include <sys/mount.h>
 #include <sys/fs_types.h>
 #endif
@@ -127,7 +123,7 @@ xatoi (cp)
 }
 #endif /* MOUNTED_GETMNTENT1.  */
 
-#ifdef MOUNTED_GETMNTINFO      /* 4.4BSD.  */
+#if defined (MOUNTED_GETMNTINFO) && !defined (__NetBSD__)
 static char *
 fstype_to_string (t)
      short t;
@@ -255,7 +251,11 @@ read_filesystem_list (need_fs_type, all_fs)
        me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
        me->me_devname = xstrdup (fsp->f_mntfromname);
        me->me_mountdir = xstrdup (fsp->f_mntonname);
+#ifdef __NetBSD__
+       me->me_type = xstrdup (fsp->f_fstypename);
+#else
        me->me_type = fstype_to_string (fsp->f_type);
+#endif
        me->me_dev = -1;        /* Magic; means not known yet. */
        me->me_next = NULL;