]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Correct msyslog.c build break on Solaris 2.9 from #ifdef/#if mixup.
authorDave Hart <hart@ntp.org>
Fri, 14 Jan 2011 07:50:28 +0000 (07:50 +0000)
committerDave Hart <hart@ntp.org>
Fri, 14 Jan 2011 07:50:28 +0000 (07:50 +0000)
bk: 4d300044CIATJKL6lE9LHtH_5owp9A

ChangeLog
libntp/msyslog.c

index 07f51dd6b93a0e655b75c1e408040a00e71fa6a7..7fa7d58f1d750189a0fc914e2eb2036356f0f07e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Correct msyslog.c build break on Solaris 2.9 from #ifdef/#if mixup.
 (4.2.7p117) 2011/01/13 Released by Harlan Stenn <stenn@ntp.org>
 * Add configure --without-sntp option to disable building sntp and
   sntp/tests.  withsntp=no in the environment changes the default.
index 47e3492dafc16670d725c4dc1eec8456db1d32dc..6b3453632a3f7078adce3681eda475619fa3fb9c 100644 (file)
@@ -54,19 +54,28 @@ errno_to_str(
        size_t  bufsiz
        )
 {
+# if defined(STRERROR_R_CHAR_P) || !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 */