[BusyBox-cvs] busybox/util-linux mount.c,1.113,1.114

Erik Andersen andersen at busybox.net
Tue Dec 9 23:50:27 UTC 2003


Update of /var/cvs/busybox/util-linux
In directory winder:/tmp/cvs-serv369/util-linux

Modified Files:
	mount.c 
Log Message:
Fix indenting.

Fix a bug noticed by Pete Flugstad.  Make certain we close what we open, and
don't try to close invalid files when /etc/filesystems exists and is used. 



Index: mount.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/mount.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- mount.c	22 Jul 2003 08:25:37 -0000	1.113
+++ mount.c	9 Dec 2003 23:50:24 -0000	1.114
@@ -273,8 +273,7 @@
 					filesystemType = buf;
 
 					if (bb_strlen(filesystemType)) {
-						status =
-							do_mount(blockDevice, directory, filesystemType,
+						status = do_mount(blockDevice, directory, filesystemType,
 									 flags | MS_MGC_VAL, string_flags,
 									 useMtab, fakeIt, mtab_opts, mount_all);
 						if (status) {
@@ -287,7 +286,8 @@
 			fclose(f);
 		}
 
-		if ((!f || read_proc) && !status) {
+		if (read_proc && !status) {
+			
 			f = bb_xfopen("/proc/filesystems", "r");
 
 			while (fgets(buf, sizeof(buf), f) != NULL) {
@@ -303,8 +303,7 @@
 					filesystemType = buf;
 					filesystemType++;	/* hop past tab */
 
-					status =
-						do_mount(blockDevice, directory, filesystemType,
+					status = do_mount(blockDevice, directory, filesystemType,
 								 flags | MS_MGC_VAL, string_flags, useMtab,
 								 fakeIt, mtab_opts, mount_all);
 					if (status) {
@@ -312,8 +311,8 @@
 					}
 				}
 			}
+			fclose(f);
 		}
-		fclose(f);
 	} else {
 		status =
 			do_mount(blockDevice, directory, filesystemType,




More information about the busybox-cvs mailing list