More fixes.  Type "auto" should mean unspecified from fstab as well as the
command line, initialize singlemount's rc to an error value so it doesn't
think it succeeded when it didn't, use absolute path when associating a
loop device (and the previous FEATURE_CLEAN_UP logic related to that was
freeing the wrong thing), move reading of /proc/filesystems to where we can
re-read it (when it's empty) for every entry on a "mount -a" so that when
/proc is mounted as the first entry, the later filesystems can autodetect
filesystem type.

diff --git a/util-linux/mount.c b/util-linux/mount.c
index c5aec74..5ddf54c 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -201,6 +201,7 @@
 	char *filteropts = 0;
 
 	parse_mount_options(mp->mnt_opts, &filteropts);
+
 	// Mount, with fallback to read-only if necessary.
 
 	for(;;) {
@@ -261,13 +262,17 @@
 
 static int singlemount(struct mntent *mp)
 {
-	int rc = 0, vfsflags;
+	int rc = 1, vfsflags;
 	char *loopFile = 0;
 	llist_t *fl = 0;
 	struct stat st;
 
 	vfsflags = parse_mount_options(mp->mnt_opts, 0);
 
+	// Treat fstype "auto" as unspecified.
+
+	if (mp->mnt_type && !strcmp(mp->mnt_type,"auto")) mp->mnt_type = 0;
+
 	// Might this be an NFS filesystem?
 
 	if (ENABLE_FEATURE_MOUNT_NFS &&
@@ -294,7 +299,7 @@
 		// Do we need to allocate a loopback device for it?
 	
 		if (ENABLE_FEATURE_MOUNT_LOOP && S_ISREG(st.st_mode)) {
-			loopFile = mp->mnt_fsname;
+			loopFile = bb_simplify_path(mp->mnt_fsname);
 			mp->mnt_fsname = 0;
 			switch(set_loop(&(mp->mnt_fsname), loopFile, 0)) {
 				case 0:
@@ -306,7 +311,7 @@
 					   	: "Couldn't setup loop device");
 					return errno;
 			}
-			
+
 		// Autodetect bind mounts
 
 		} else if (S_ISDIR(st.st_mode) && !mp->mnt_type) vfsflags |= MS_BIND;
@@ -320,18 +325,34 @@
 
 	// Loop through filesystem types until mount succeeds or we run out
 
-	else for (fl = fslist; fl; fl = fl->link) {
-		mp->mnt_type = fl->data;
+	else {
 
-		if (!(rc = mount_it_now(mp,vfsflags))) break;
+		/* Initialize list of block backed filesystems.  This has to be
+		 * done here so that during "mount -a", mounts after /proc shows up
+		 * can autodetect. */
 
-		mp->mnt_type = 0;
+		if (!fslist) {
+			fslist = get_block_backed_filesystems();
+			if (ENABLE_FEATURE_CLEAN_UP && fslist)
+				atexit(delete_block_backed_filesystems);
+		}
+	
+		for (fl = fslist; fl; fl = fl->link) {
+			mp->mnt_type = fl->data;
+
+			if (!(rc = mount_it_now(mp,vfsflags))) break;
+
+			mp->mnt_type = 0;
+		}
 	}
 
 	// Mount failed.  Clean up
 	if (rc && loopFile) {
 		del_loop(mp->mnt_fsname);
-		if(ENABLE_FEATURE_CLEAN_UP) free(loopFile);
+		if(ENABLE_FEATURE_CLEAN_UP) {
+			free(loopFile);
+			free(mp->mnt_fsname);
+		}
 	}
 	return rc;
 }
@@ -389,10 +410,6 @@
 		}
 	}
 	
-	// Ignore type "auto".
-
-	if (fstype && !strcmp(fstype, "auto")) fstype = NULL;
-
 	// Three or more non-option arguments?  Die with a usage message.
 
 	if (optind-argc>2) bb_show_usage();
@@ -421,11 +438,6 @@
 		}
 	}
 
-	/* Initialize list of block backed filesystems */
-
-	fslist = get_block_backed_filesystems();
-	if (ENABLE_FEATURE_CLEAN_UP) atexit(delete_block_backed_filesystems);
-	
 	// When we have two arguments, the second is the directory and we can
 	// skip looking at fstab entirely.  We can always abspath() the directory
 	// argument when we get it.
@@ -483,7 +495,7 @@
 			}
 			break;
 		}
-		
+
 		/* If we're trying to mount something specific and this isn't it,
 		 * skip it.  Note we must match both the exact text in fstab (ala
 		 * "proc") or a full path from root */