diff options
author | Karel Zak | 2006-12-07 00:26:28 +0100 |
---|---|---|
committer | Karel Zak | 2006-12-07 00:26:28 +0100 |
commit | 5213517f54c70a784c06ee85c066aa2b4f375c4b (patch) | |
tree | bd0b55ed9621bf27f70fc2e338a9816496246beb /mount | |
parent | Imported from util-linux-2.12k tarball. (diff) | |
download | kernel-qcow2-util-linux-5213517f54c70a784c06ee85c066aa2b4f375c4b.tar.gz kernel-qcow2-util-linux-5213517f54c70a784c06ee85c066aa2b4f375c4b.tar.xz kernel-qcow2-util-linux-5213517f54c70a784c06ee85c066aa2b4f375c4b.zip |
Imported from util-linux-2.12l tarball.
Diffstat (limited to 'mount')
-rw-r--r-- | mount/swapon.c | 5 | ||||
-rw-r--r-- | mount/umount.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/mount/swapon.c b/mount/swapon.c index dce1bf877..17c45cbdd 100644 --- a/mount/swapon.c +++ b/mount/swapon.c @@ -306,6 +306,7 @@ main_swapon(int argc, char *argv[]) { while ((fstab = getmntent(fp)) != NULL) { char *special = fstab->mnt_fsname; int skip = 0; + int pri = priority; if (streq(fstab->mnt_type, MNTTYPE_SWAP) && !is_in_proc_swaps(special) @@ -316,12 +317,12 @@ main_swapon(int argc, char *argv[]) { for (opt = strtok(opts, ","); opt != NULL; opt = strtok(NULL, ",")) { if (strncmp(opt, "pri=", 4) == 0) - priority = atoi(opt+4); + pri = atoi(opt+4); if (strcmp(opt, "noauto") == 0) skip = 1; } if (!skip) - status |= do_swapon(special, priority); + status |= do_swapon(special, pri); } } fclose(fp); diff --git a/mount/umount.c b/mount/umount.c index 34ca1084f..15d94f938 100644 --- a/mount/umount.c +++ b/mount/umount.c @@ -549,6 +549,11 @@ umount_file (char *arg) { int fstab_has_user, fstab_has_users, fstab_has_owner, fstab_has_group; int ok; + if (!*arg) { /* "" would be expanded to `pwd` */ + die(2, _("Cannot umount \"\"\n")); + return 0; + } + file = canonicalize(arg); /* mtab paths are canonicalized */ if (verbose > 1) printf(_("Trying to umount %s\n"), file); |