+* 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.
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 */