You'd think there'd be a compiler warning for "pointless if", wouldn't you?
authorRob Landley <rob@landley.net>
Tue, 4 Apr 2006 16:56:04 +0000 (16:56 -0000)
committerRob Landley <rob@landley.net>
Tue, 4 Apr 2006 16:56:04 +0000 (16:56 -0000)
util-linux/mount.c

index 42d0eb223767f09c139ff2dc5ef08a94770be4fe..ba55d2480159a8b2c17f937950b5eb30c2d0b789 100644 (file)
@@ -291,11 +291,11 @@ static int singlemount(struct mntent *mp)
                }
        }
 
-       // Look at the file.  (Not found isn't a failure for remount.)
+       // Look at the file.  (Not found isn't a failure for remount, or for
+       // a synthetic filesystem like proc or sysfs.)
 
        if (lstat(mp->mnt_fsname, &st));
-
-       if (!(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) {
+       else if (!(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) {
                // Do we need to allocate a loopback device for it?
 
                if (ENABLE_FEATURE_MOUNT_LOOP && S_ISREG(st.st_mode)) {