Provide an alternate getmntent() if necessary.
authorewt <devnull@localhost>
Mon, 2 Jun 1997 19:59:07 +0000 (19:59 +0000)
committerewt <devnull@localhost>
Mon, 2 Jun 1997 19:59:07 +0000 (19:59 +0000)
CVS patchset: 1679
CVS date: 1997/06/02 19:59:07

config.h.in
configure.in
misc/miscfn.h

index 14c82ea..d80551b 100644 (file)
@@ -83,4 +83,8 @@
 /* Define as one if you have <sys/mnttab.h> */
 #define HAVE_SYS_MNTTAB_H 0
 
+/* Define as one if you have getmntent(), you'll also need one of the above
+   two defined */
+#define HAVE_GETMNTENT 0
+
 #endif
index 5daa3fc..ccf449c 100644 (file)
@@ -277,6 +277,7 @@ fi
 dnl Checks for library functions.
 AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), MISCOBJS="$MISCOBJS inet_aton.o")
 AC_CHECK_FUNC(realpath, AC_DEFINE(HAVE_REALPATH), MISCOBJS="$MISCOBJS realpath.o")
+AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT), MISCOBJS="$MISCOBJS getmntent.o")
 AC_CHECK_FUNC(strerror, [], MISCOBJS="$MISCOBJS strerror.o")
 AC_CHECK_FUNC(strtol, [], MISCOBJS="$MISCOBJS strtol.o")
 AC_CHECK_FUNC(strtoul, [], MISCOBJS="$MISCOBJS strtoul.o")
index 5e5e51b..adabc77 100644 (file)
@@ -62,21 +62,29 @@ extern void *myrealloc(void *, size_t);
 #define lchown chown
 #endif
 
-#if HAVE_MNTENT_H
-#include <mntent.h>
-#define GETMNTENT_ONE 1
-#define GETMNTENT_TWO 0
-#define our_mntent struct mntent
-#define our_mntdir mnt_dir
+#if HAVE_MNTENT_H || !(HAVE_GETMNTENT)
+# if HAVE_MNTENT_H
+#  include <mntent.h>
+# else
+   #include <stdio.h>
+   struct mntent {
+       char * mnt_dir;
+   };
+   struct mntent *getmntent(FILE *filep);
+# endif
+# define GETMNTENT_ONE 1
+# define GETMNTENT_TWO 0
+# define our_mntent struct mntent
+# define our_mntdir mnt_dir
 #elif HAVE_SYS_MNTTAB_H
-#include <stdio.h>
-#include <sys/mnttab.h>
-#define GETMNTENT_ONE 0
-#define GETMNTENT_TWO 1
-#define our_mntdir mnt_mountp
-#define our_mntent struct mnttab
+# include <stdio.h>
+# include <sys/mnttab.h>
+# define GETMNTENT_ONE 0
+# define GETMNTENT_TWO 1
+# define our_mntent struct mnttab
+# define our_mntdir mnt_mountp
 #else
-#error Neither mntent.h nor mnttab.h exists. I cannot build on this system.
+# error Neither mntent.h nor mnttab.h exists. I cannot build on this system.
 #endif
 
 #ifndef MOUNTED