bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] getloadavg test: skip the test on GNU/Linux without /proc mo


From: Dmitry V. Levin
Subject: Re: [PATCH] getloadavg test: skip the test on GNU/Linux without /proc mounted
Date: Thu, 12 Jan 2012 00:49:06 +0400

Ping?

----- Forwarded message from "Dmitry V. Levin" <address@hidden> -----

Date: Sun, 24 Apr 2011 13:44:38 +0400
From: "Dmitry V. Levin" <address@hidden>
To: address@hidden
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 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 82c8468..0569fe0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-04-24  Dmitry V. Levin  <address@hidden>
+
+       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.
+
 2011-04-22  Paul Eggert  <address@hidden>
 
        * modules/strnlen (Depends-on): Remove memchr.
diff --git a/tests/test-getloadavg.c b/tests/test-getloadavg.c
index f039776..fc5d59f 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;
-- 
ldv

----- End forwarded message -----

-- 
ldv

Attachment: pgpZVzsOY6apj.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]