summaryrefslogtreecommitdiffstats
path: root/mount/swapon.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:26:24 +0100
committerKarel Zak2006-12-07 00:26:24 +0100
commitd162fcb550a77875c8f58fda0e0a0bd91f211c99 (patch)
treebd984959acd465b3058bd805f216d29dc0c3c1a6 /mount/swapon.c
parentImported from util-linux-2.12i tarball. (diff)
downloadkernel-qcow2-util-linux-d162fcb550a77875c8f58fda0e0a0bd91f211c99.tar.gz
kernel-qcow2-util-linux-d162fcb550a77875c8f58fda0e0a0bd91f211c99.tar.xz
kernel-qcow2-util-linux-d162fcb550a77875c8f58fda0e0a0bd91f211c99.zip
Imported from util-linux-2.12j tarball.
Diffstat (limited to 'mount/swapon.c')
-rw-r--r--mount/swapon.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mount/swapon.c b/mount/swapon.c
index 71b251508..f347c2c79 100644
--- a/mount/swapon.c
+++ b/mount/swapon.c
@@ -315,6 +315,7 @@ main_swapon(int argc, char *argv[]) {
}
while ((fstab = getmntent(fp)) != NULL) {
char *special = fstab->mnt_fsname;
+ int skip = 0;
if (streq(fstab->mnt_type, MNTTYPE_SWAP) &&
!is_in_proc_swaps(special)
@@ -323,10 +324,14 @@ main_swapon(int argc, char *argv[]) {
char *opt, *opts = strdup(fstab->mnt_opts);
for (opt = strtok(opts, ","); opt != NULL;
- opt = strtok(NULL, ","))
+ opt = strtok(NULL, ",")) {
if (strncmp(opt, "pri=", 4) == 0)
priority = atoi(opt+4);
- status |= do_swapon(special, priority);
+ if (strcmp(opt, "noauto") == 0)
+ skip = 1;
+ }
+ if (!skip)
+ status |= do_swapon(special, priority);
}
}
fclose(fp);