diff options
author | jkh <jkh@FreeBSD.org> | 1996-09-06 06:01:05 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-09-06 06:01:05 +0000 |
commit | 1cb64d5ccae3c42d7bad62721b2355b3d4840cd9 (patch) | |
tree | 2f85876e6293ce03cabad196fc6085f709bd6b68 /sbin/swapon | |
parent | c93475e95f3e8a436294b39440480c78012ba35b (diff) | |
download | FreeBSD-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/swapon')
-rw-r--r-- | sbin/swapon/swapon.8 | 2 | ||||
-rw-r--r-- | sbin/swapon/swapon.c | 2 |
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 |