diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-05 07:01:35 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-05 07:01:35 +0000 |
commit | 80e69562be86d149d753530a8a57c5babbb3f4c3 (patch) | |
tree | 021a608559e734833a7d23f03444fde66bf38076 /srUtils.c | |
parent | 05ba3fbffeaa3142e917ea69e9e39209e893581a (diff) | |
download | rsyslog-80e69562be86d149d753530a8a57c5babbb3f4c3.tar.gz rsyslog-80e69562be86d149d753530a8a57c5babbb3f4c3.tar.xz rsyslog-80e69562be86d149d753530a8a57c5babbb3f4c3.zip |
did some portability changes to make rsyslog compile on HP UX
Diffstat (limited to 'srUtils.c')
-rwxr-xr-x | srUtils.c | 25 |
1 files changed, 17 insertions, 8 deletions
@@ -67,6 +67,9 @@ syslogName_t syslogPriNames[] = { {NULL, -1} }; +#ifndef LOG_AUTHPRIV +# define LOG_AUTHPRIV LOG_AUTH +#endif syslogName_t syslogFacNames[] = { {"auth", LOG_AUTH}, {"authpriv", LOG_AUTHPRIV}, @@ -449,15 +452,21 @@ srSleep(int iSeconds, int iuSeconds) * Added 2008-01-30 */ char *rs_strerror_r(int errnum, char *buf, size_t buflen) { -#ifdef STRERROR_R_CHAR_P - char *p = strerror_r(errnum, buf, buflen); - if (p != buf) { - strncpy(buf, p, buflen); - buf[buflen - 1] = '\0'; - } +#ifdef __hpux + char *pszErr; + pszErr = strerror(errnum); + snprintf(buf, buflen, "%s", pszErr); #else - strerror_r(errnum, buf, buflen); -#endif +# ifdef STRERROR_R_CHAR_P + char *p = strerror_r(errnum, buf, buflen); + if (p != buf) { + strncpy(buf, p, buflen); + buf[buflen - 1] = '\0'; + } +# else + strerror_r(errnum, buf, buflen); +# endif +#endif /* #ifdef __hpux */ return buf; } |