venti: warn when opening /dev/swap fails
This commit is contained in:
parent
e7715ce2c6
commit
065cf0b708
1 changed files with 2 additions and 0 deletions
|
@ -55,6 +55,8 @@ freemem(void)
|
||||||
Bterm(bp);
|
Bterm(bp);
|
||||||
if (pgsize > 0 && userpgs > 0 && userused > 0)
|
if (pgsize > 0 && userpgs > 0 && userused > 0)
|
||||||
size = (userpgs - userused) * pgsize;
|
size = (userpgs - userused) * pgsize;
|
||||||
|
} else {
|
||||||
|
fprint(2, "%s: failed to open /dev/swap\n", argv0);
|
||||||
}
|
}
|
||||||
/* cap it to keep the size within 32 bits */
|
/* cap it to keep the size within 32 bits */
|
||||||
if (size >= 3840UL * 1024 * 1024){
|
if (size >= 3840UL * 1024 * 1024){
|
||||||
|
|
Loading…
Reference in a new issue