summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'sbin')
-rw-r--r--sbin/swapon/swapon.82
-rw-r--r--sbin/swapon/swapon.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/sbin/swapon/swapon.8 b/sbin/swapon/swapon.8
index 1567607..02a6111 100644
--- a/sbin/swapon/swapon.8
+++ b/sbin/swapon/swapon.8
@@ -61,7 +61,7 @@ Normally, the first form is used:
All devices marked as ``sw''
swap devices in
.Pa /etc/fstab
-are made available.
+are made available unless their ``noauto'' option is also set.
.El
.Pp
The second form gives individual block devices as given
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c
index 042a853..2a07b53 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -76,6 +76,8 @@ main(int argc, char **argv)
while ((fsp = getfsent()) != NULL) {
if (strcmp(fsp->fs_type, FSTAB_SW))
continue;
+ if (strstr(fsp->fs_mntops, "noauto"))
+ continue;
if (add(fsp->fs_spec, 1))
stat = 1;
else
OpenPOWER on IntegriCloud