diff options
author | Ori Bernstein <ori@eigenstate.org> | 2021-06-21 12:29:52 +0000 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2021-06-21 12:29:52 +0000 |
commit | 214dc1ec6c5d98f52bee48b18eed7dabb32a5714 (patch) | |
tree | be731f4894444fcd5ac7c518a0aed4b4346f2e06 | |
parent | 068f403e7111016383f65b46eeffd5ae592964f2 (diff) | |
download | plan9front-214dc1ec6c5d98f52bee48b18eed7dabb32a5714.tar.xz |
venti: make error messages consistent, remove duplicate messages.
removes duplicate messaes about restrictions, and duplicate
checks, makes the error match the rest of the errors.
-rwxr-xr-x | sys/src/cmd/venti/srv/venti.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/src/cmd/venti/srv/venti.c b/sys/src/cmd/venti/srv/venti.c index 8a631314a..87361a0e1 100755 --- a/sys/src/cmd/venti/srv/venti.c +++ b/sys/src/cmd/venti/srv/venti.c @@ -55,20 +55,17 @@ freemem(void) Bterm(bp); if (pgsize > 0 && userpgs > 0 && userused > 0) size = (userpgs - userused) * pgsize; - } else { + } else fprint(2, "%s: failed to open /dev/swap\n", argv0); - } /* cap it to keep the size within 32 bits */ - if (size >= 3840UL * 1024 * 1024){ - size = 3840UL * 1024 * 1024; - fprint(2, "%s: Reduced free memory detected to 3840MiB because we don't support 64-bit addresses yet.\n", argv0); - } /* FIXME: we use signed 32-bit integers in some places for some fucking reason. - Limiting accordingly for now. - */ - if (size >= 2047UL * 1024 * 1024){ + * Limiting accordingly for now. + * if (size >= 3840UL * 1024 * 1024) + * size = 3840UL * 1024 * 1024; + */ + if (size >= 2047UL * 1024 * 1024) { size = 2047UL * 1024 * 1024; - fprint(2, "%s: Reduced free memory detected to 2047MiB because we have bugz.\n", argv0); + fprint(2, "%s: mem pct overflows: restricting to 2047MiB\n", argv0); } return size; } @@ -110,7 +107,7 @@ allocbypcnt(u32int mempcnt, u32int stfree) else { if (avail >= 2047UL * 1024 * 1024){ avail = 2047UL * 1024 * 1024; /* sanity */ - fprint(2, "%s: restricting memory usage to 2047MiB\n", argv0); + fprint(2, "%s: mem pct overflows: restricting to 2047MiB\n", argv0); } avail /= 2; all.icmem = avail; |