From 92f1c30e37851a1d32330febc0dfd2548f3f64c5 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 12 Jan 2012 00:49:06 +0400 Subject: [PATCH] getloadavg test: skip the test on GNU/Linux without /proc mounted GNU libc implements getloadavg(3) on Linux by parsing /proc/loadavg file. When /proc is not mounted, it always fails with ENOENT. * tests/test-getloadavg.c (main): Treat ENOENT return code from getloadavg(3) the same way as ENOSYS and ENOTSUP. --- ChangeLog | 8 ++++++++ tests/test-getloadavg.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f302d8885..9d5f7460a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-01-11 Dmitry V. Levin + + getloadavg test: skip the test on GNU/Linux without /proc mounted + GNU libc implements getloadavg(3) on Linux by parsing /proc/loadavg + file. When /proc is not mounted, it always fails with ENOENT. + * tests/test-getloadavg.c (main): Treat ENOENT return code from + getloadavg(3) the same way as ENOSYS and ENOTSUP. + 2012-01-10 Bruno Haible regex: Avoid link error on MSVC 9. diff --git a/tests/test-getloadavg.c b/tests/test-getloadavg.c index afed69c7f..39a837547 100644 --- a/tests/test-getloadavg.c +++ b/tests/test-getloadavg.c @@ -60,7 +60,7 @@ main (int argc, char **argv) int loads = getloadavg (avg, 3); if (loads == -1) { - if (! (errno == ENOSYS || errno == ENOTSUP)) + if (! (errno == ENOSYS || errno == ENOTSUP || errno == ENOENT)) return 1; perror ("Skipping test; load average not supported"); return 77; -- 2.11.0