Applied patch from Magnus Damm <damm@opensource.se> to fix a 'inner scope var
authorMark Whitley <markw@lineo.com>
Mon, 26 Feb 2001 17:45:58 +0000 (17:45 -0000)
committerMark Whitley <markw@lineo.com>
Mon, 26 Feb 2001 17:45:58 +0000 (17:45 -0000)
masking outer scope var with same name' bug that was preventing the loopback
device from being unmounted if mount() fails.

mount.c
util-linux/mount.c

diff --git a/mount.c b/mount.c
index 7b0bf3e..551695b 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -128,7 +128,8 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 #if defined BB_FEATURE_MOUNT_LOOP
                if (use_loop==TRUE) {
                        int loro = flags & MS_RDONLY;
-                       char *lofile = specialfile;
+                       
+                       lofile = specialfile;
 
                        specialfile = find_unused_loop_device();
                        if (specialfile == NULL) {
index 7b0bf3e..551695b 100644 (file)
@@ -128,7 +128,8 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 #if defined BB_FEATURE_MOUNT_LOOP
                if (use_loop==TRUE) {
                        int loro = flags & MS_RDONLY;
-                       char *lofile = specialfile;
+                       
+                       lofile = specialfile;
 
                        specialfile = find_unused_loop_device();
                        if (specialfile == NULL) {