Tests for module 'get-rusage-data'.
[gnulib.git] / m4 / strerror_r.m4
index 016009f..3897da6 100644 (file)
@@ -1,5 +1,5 @@
-# strerror_r.m4 serial 1
-dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc.
+# strerror_r.m4 serial 3
+dnl Copyright (C) 2002, 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -49,9 +49,13 @@ AC_DEFUN([gl_FUNC_STRERROR_R],
                   #include <string.h>
                   int strerror_r (int, char *, size_t);
                 ]],
-                [[char buf[79];
-                  return strerror (EACCES, buf, 0) < 0
-                         || strerror_r (EACCES, buf, sizeof (buf)) != 0;
+                [[int result = 0;
+                  char buf[79];
+                  if (strerror_r (EACCES, buf, 0) < 0)
+                    result |= 1;
+                  if (strerror_r (EACCES, buf, sizeof (buf)) != 0)
+                    result |= 2;
+                  return result;
                 ]])],
              [gl_cv_func_strerror_r_works=yes],
              [gl_cv_func_strerror_r_works=no],