]> arthur.barton.de Git - bup.git/commit
cmd/memtest: use getrusage() instead of /proc/self/stat.
authorAvery Pennarun <apenwarr@gmail.com>
Mon, 6 Sep 2010 04:52:10 +0000 (21:52 -0700)
committerAvery Pennarun <apenwarr@gmail.com>
Mon, 6 Sep 2010 05:49:34 +0000 (22:49 -0700)
commit479b8dd89a459f173c4d3ce61b6928b42825e170
treedf08aaf1d4e976b7ea9a7f4351924beffe9adb1e
parent94c3b43be36773624aa073583806751bb97ba023
cmd/memtest: use getrusage() instead of /proc/self/stat.

Only Linux has /proc/self/stat, so 'bup memtest' didn't work on anything
except Linux.  Unfortunately, getrusage() on *Linux* doesn't have a valid
RSS field (sigh), so we have to use /proc/self/stat as a fallback if it's
zero.

Now memtest works on MacOS as well, which means 'make test' passes again.
(It stopped passing because 'bup memtest' recently got added to one of the
tests.)

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/memtest-cmd.py