summaryrefslogtreecommitdiffstats
path: root/srUtils.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-05 07:01:35 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-05 07:01:35 +0000
commit80e69562be86d149d753530a8a57c5babbb3f4c3 (patch)
tree021a608559e734833a7d23f03444fde66bf38076 /srUtils.c
parent05ba3fbffeaa3142e917ea69e9e39209e893581a (diff)
downloadrsyslog-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-xsrUtils.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/srUtils.c b/srUtils.c
index b871861b..fa451b7e 100755
--- a/srUtils.c
+++ b/srUtils.c
@@ -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;
}