summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-09-06 06:01:05 +0000
committerjkh <jkh@FreeBSD.org>1996-09-06 06:01:05 +0000
commit1cb64d5ccae3c42d7bad62721b2355b3d4840cd9 (patch)
tree2f85876e6293ce03cabad196fc6085f709bd6b68 /sbin
parentc93475e95f3e8a436294b39440480c78012ba35b (diff)
downloadFreeBSD-src-1cb64d5ccae3c42d7bad62721b2355b3d4840cd9.zip
FreeBSD-src-1cb64d5ccae3c42d7bad62721b2355b3d4840cd9.tar.gz
Make the noauto flag usable for swap devices too. Closes PR#1542
Submitted-By: David Leonard <d@scry.dstc.edu.au>
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