Index: client-src/getfsent.c
===================================================================
RCS file: /cvsroot/amanda/amanda/client-src/getfsent.c,v
retrieving revision 1.20
diff -u -r1.20 getfsent.c
--- client-src/getfsent.c	1998/07/04 00:18:14	1.20
+++ client-src/getfsent.c	2001/01/23 00:08:57
@@ -141,30 +141,52 @@
 */
 #define GETFSENT_TYPE "SVR3 (NeXTstep, Irix, Linux, HP-UX)"
 
+#define	HAVE_SETMNTENT			/*JJ*/
+
 #include <mntent.h>
 
-static FILE *fstabf = NULL;
+static FILE *fstabf1 = NULL;		/* /proc/mounts */
+static FILE *fstabf2 = NULL;		/* MNTTAB */
 
 int open_fstab()
 {
     close_fstab();
-    return (fstabf = fopen(MNTTAB, "r")) != NULL;
+#if defined(HAVE_SETMNTENT)
+    fstabf1 = setmntent("/proc/mounts", "r");
+    fstabf2 = setmntent(MNTTAB, "r");
+#else
+    fstabf2 = fopen(MNTTAB, "r");
+#endif
+    return (fstabf1 != NULL || fstabf2 != NULL);
 }
 
 void close_fstab()
 {
-    if(fstabf)
-	afclose(fstabf);
-    fstabf = NULL;
+    afclose(fstabf1);
+    afclose(fstabf2);
 }
 
 int get_fstab_nextentry(fsent)
 generic_fsent_t *fsent;
 {
-    struct mntent *sys_fsent = getmntent(fstabf);
+    struct mntent *sys_fsent = NULL;
 
-    if(!sys_fsent)
+    if(fstabf1) {
+	sys_fsent = getmntent(fstabf1);
+	if(!sys_fsent) {
+	    afclose(fstabf1);
+	}
+    }
+    if(!sys_fsent && fstabf2) {
+	sys_fsent = getmntent(fstabf2);
+	if(!sys_fsent) {
+	    afclose(fstabf2);
+	}
+    }
+    if(!sys_fsent) {
 	return 0;
+    }
+
     fsent->fsname  = sys_fsent->mnt_fsname;
     fsent->fstype  = sys_fsent->mnt_type;
     fsent->mntdir  = sys_fsent->mnt_dir;
