Browse Source

Fixed detection of the filesystem information on NetBSD 3.0.

Roland Illig 19 years ago
parent
commit
d647096f53
4 changed files with 31 additions and 2 deletions
  1. 6 0
      ChangeLog
  2. 7 2
      configure.ac
  3. 4 0
      src/ChangeLog
  4. 14 0
      src/mountlist.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2006-05-21  Roland Illig  <roland.illig@gmx.de>
+
+	* configure.ac: Fixed detection of <sys/statvfs.h>, statvfs()
+	and struct statvfs.f_fstypename, so that mc builds on NetBSD 3.0
+	again.
+
 2006-04-18  Pavel Tsekov  <ptsekov@gmx.net>
 
 	* acinclude.m4 (AC_GET_FS_INFO): Make it work again - the last

+ 7 - 2
configure.ac

@@ -158,7 +158,7 @@ AC_CHECK_HEADERS([unistd.h string.h memory.h grp.h limits.h malloc.h \
 	stdlib.h termios.h utime.h fcntl.h pwd.h sys/statfs.h sys/time.h \
 	sys/timeb.h sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
 	security/pam_misc.h sys/socket.h sys/sysmacros.h sys/types.h \
-	sys/mkdev.h wchar.h wctype.h])
+	sys/mkdev.h wchar.h wctype.h sys/statvfs.h])
 
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
@@ -167,6 +167,11 @@ AC_HEADER_STDC
 
 dnl Missing structure components
 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
+AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,,
+[AC_INCLUDES_DEFAULT()
+#ifdef HAVE_SYS_STATVFS_H
+#  include <sys/statvfs.h>
+#endif])
 AC_STRUCT_ST_BLOCKS
 
 dnl
@@ -180,7 +185,7 @@ AC_CHECK_FUNCS([\
 	initgroups isascii \
 	memcpy memmove memset \
 	putenv \
-	setreuid setuid statfs strerror strftime sysconf \
+	setreuid setuid statfs statvfs strerror strftime sysconf \
 	tcgetattr tcsetattr truncate \
 ])
 

+ 4 - 0
src/ChangeLog

@@ -1,3 +1,7 @@
+2006-05-21  Roland Illig  <roland.illig@gmx.de>
+
+	* mountlist.c: Fixed so that it builds on NetBSD 3.0.
+
 2006-05-15  Pavel Tsekov  <ptsekov@gmx.net>
 
 	* tty.h [USE_NCURSES]: Pull in term.h if WANT_TERM_H is defined.

+ 14 - 0
src/mountlist.c

@@ -119,6 +119,16 @@
 #    define HAVE_INFOMOUNT
 #endif
 
+#if defined(HAVE_STATVFS)
+#  if defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)
+#    define HAVE_F_FSTYPENAME
+#  endif
+#else
+#  if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
+#    define HAVE_F_FSTYPENAME
+#  endif
+#endif
+
 /* A mount table entry. */
 struct mount_entry
 {
@@ -282,7 +292,11 @@ read_filesystem_list (int need_fs_type, int all_fs)
 
 #ifdef MOUNTED_GETMNTINFO	/* 4.4BSD.  */
     {
+#ifdef HAVE_STATVFS
+	struct statvfs *fsp;
+#else
 	struct statfs *fsp;
+#endif
 	int entries;
 
 	entries = getmntinfo (&fsp, MNT_NOWAIT);