+ // End of fstab/mtab is reached.
+ // Were we looking for something specific?
+ if (argv[0]) { // yes
+ long l;
+
+ // If we didn't find anything, complain
+ if (!mtcur->mnt_fsname)
+ bb_error_msg_and_die("can't find %s in %s",
+ argv[0], fstabname);
+
+ // What happens when we try to "mount swap_partition"?
+ // (fstab containts "swap_partition swap swap defaults 0 0")
+ // util-linux-ng 2.13.1 does this:
+ // stat("/sbin/mount.swap", 0x7fff62a3a350) = -1 ENOENT (No such file or directory)
+ // mount("swap_partition", "swap", "swap", MS_MGC_VAL, NULL) = -1 ENOENT (No such file or directory)
+ // lstat("swap", 0x7fff62a3a640) = -1 ENOENT (No such file or directory)
+ // write(2, "mount: mount point swap does not exist\n", 39) = 39
+ // exit_group(32) = ?
+#if 0
+ // In case we want to simply skip swap partitions:
+ l = parse_mount_options(mtcur->mnt_opts, NULL);
+ if ((l & MOUNT_SWAP)
+ // swap is bogus "fstype", parse_mount_options can't check fstypes
+ || strcasecmp(mtcur->mnt_type, "swap") == 0
+ ) {
+ goto ret;
+ }
+#endif
+ if (nonroot) {
+ // fstab must have "users" or "user"
+ l = parse_mount_options(mtcur->mnt_opts, NULL);
+ if (!(l & MOUNT_USERS))
+ bb_error_msg_and_die(bb_msg_you_must_be_root);
+ }
+
+ //util-linux-2.12 does not do this check.
+ //// If nothing is mounted on this directory...
+ //// (otherwise repeated "mount FOO" mounts FOO again)
+ //mp = find_mount_point(mtcur->mnt_dir, /*subdir_too:*/ 0);
+ //if (mp) {
+ // bb_error_msg("according to %s, "
+ // "%s is already mounted on %s",
+ // bb_path_mtab_file,
+ // mp->mnt_fsname, mp->mnt_dir);
+ //} else {
+ // ...mount the last thing we found
+ mtcur->mnt_opts = xstrdup(mtcur->mnt_opts);
+ append_mount_options(&(mtcur->mnt_opts), cmdopts);
+ resolve_mount_spec(&mtpair->mnt_fsname);
+ rc = singlemount(mtcur, /*ignore_busy:*/ 0);
+ if (ENABLE_FEATURE_CLEAN_UP)
+ free(mtcur->mnt_opts);
+ //}
+ }