summaryrefslogtreecommitdiff
path: root/sys/vm/vm_swap.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-08-18 13:56:00 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-08-18 13:56:00 +0000
commit89850175b7c8e7cd5ad6e0c5e98cf77baef85650 (patch)
treeb3bfe7e5f57c9c56a6ed40f52375586e498a77a5 /sys/vm/vm_swap.c
parent0ddc477e65aaf0ff6fc3647e9d2811c0b66a34c8 (diff)
if no swap has been configured at boot time, swapon could not add
the first swap partition. This was a problem with ccd- or vnd-only swap setups
Diffstat (limited to 'sys/vm/vm_swap.c')
-rw-r--r--sys/vm/vm_swap.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 7dd10c6979f..47bd8ba7ac1 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_swap.c,v 1.5 1997/05/22 07:26:53 deraadt Exp $ */
+/* $OpenBSD: vm_swap.c,v 1.6 1997/08/18 13:55:59 niklas Exp $ */
/* $NetBSD: vm_swap.c,v 1.32 1996/02/05 01:54:09 christos Exp $ */
/*
@@ -399,9 +399,12 @@ swfree(p, index)
nswap += nblks;
}
#else
- perdev = nswap / nswdev;
- if (nblks > perdev)
- nblks = perdev;
+ if (nswap > 0) {
+ perdev = nswap / nswdev;
+ if (nblks > perdev)
+ nblks = perdev;
+ } else
+ nswap = nblks;
#endif
sp->sw_nblks = nblks;
}