]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Some systems do not have strerror_r
authorHarlan Stenn <stenn@ntp.org>
Wed, 12 Jan 2011 23:57:28 +0000 (18:57 -0500)
committerHarlan Stenn <stenn@ntp.org>
Wed, 12 Jan 2011 23:57:28 +0000 (18:57 -0500)
bk: 4d2e3fe8eia2yLXFhAYROysAzrjHXQ

libntp/msyslog.c

index d90e728503018815db1ec4449977f8a9f5f84aac..47e3492dafc16670d725c4dc1eec8456db1d32dc 100644 (file)
@@ -54,28 +54,19 @@ errno_to_str(
        size_t  bufsiz
        )
 {
-# if defined(STRERROR_R_CHAR_P) || !defined(HAVE_DECL_STRERROR_R)
        char *  pstatic;
 
-#  ifdef STRERROR_R_CHAR_P
+# ifdef STRERROR_R_CHAR_P
        /*
         * For older GNU strerror_r, the return value either points to
         * buf, or to static storage.  We want the result always in buf
         */
        pstatic = strerror_r(err, buf, bufsiz);
-#  else
+# else
        pstatic = strerror(err);
-#  endif
+# endif
        if (pstatic != buf)
                strncpy(buf, pstatic, bufsiz);
-# else
-       int     rc;
-
-       rc = strerror_r(err, buf, bufsiz);
-       if (rc < 0)
-               snprintf(buf, bufsiz, "strerror_r(%d): errno %d",
-                        err, errno);
-# endif
 }
 #endif /* errno_to_str */