just include fcntl.h not sys/fcntl.h
[oweals/busybox.git] / util-linux / mount.c
index fbb4e36c4f9a9c7252650f7fd46a0b5bce9f77ca..68f48355539e41ecee669e75938e3fb4bf3b67a8 100644 (file)
@@ -284,6 +284,7 @@ static int singlemount(struct mntent *mp)
                        return 1;
                } else {
                        // Strangely enough, nfsmount() doesn't actually mount() anything.
+                       mp->mnt_type = "nfs";
                        rc = mount_it_now(mp, vfsflags, filteropts);
                        if (ENABLE_FEATURE_CLEAN_UP) free(filteropts);
                        
@@ -291,11 +292,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)) {
@@ -475,8 +476,9 @@ int mount_main(int argc, char **argv)
 
                // Get next fstab entry
 
-               if (!getmntent_r(fstab, mtcur, bb_common_bufsiz1,
-                                       sizeof(bb_common_bufsiz1)))
+               if (!getmntent_r(fstab, mtcur, bb_common_bufsiz1
+                                       + (mtcur==mtpair ? sizeof(bb_common_bufsiz1)/2 : 0),
+                               sizeof(bb_common_bufsiz1)/2))
                {
                        // Were we looking for something specific?