diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-24 13:32:25 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-24 13:32:25 +0000 |
commit | b1ca6a351c18f38b9b6fb1b18347a099ae41ef18 (patch) | |
tree | 4fa21767d72ff73c1288e1497885a85c306fa8a8 /pidfile.c | |
parent | 7fc7824b866ef7657ba52e8d7bc806d981d73811 (diff) | |
download | rsyslog-b1ca6a351c18f38b9b6fb1b18347a099ae41ef18.tar.gz rsyslog-b1ca6a351c18f38b9b6fb1b18347a099ae41ef18.tar.xz rsyslog-b1ca6a351c18f38b9b6fb1b18347a099ae41ef18.zip |
- simplified code in shouldProcessThisMessage() for debug output
- changed strerror() calls to thread-safe strerror_r() variant
Diffstat (limited to 'pidfile.c')
-rw-r--r-- | pidfile.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -21,6 +21,8 @@ #include "config.h" +#include "rsyslog.h" + /* * Sat Aug 19 13:24:33 MET DST 1995: Martin Schulze * First version (v0.2) released @@ -117,7 +119,8 @@ int write_pid (char *pidfile) pid = getpid(); if (!fprintf(f,"%d\n", pid)) { - printf("Can't write pid , %s.\n", strerror(errno)); + char errStr[1024]; + printf("Can't write pid , %s.\n", strerror_r(errno, errStr, sizeof(errStr))); close(fd); return 0; } @@ -125,7 +128,8 @@ int write_pid (char *pidfile) #ifndef __sun if (flock(fd, LOCK_UN) == -1) { - printf("Can't unlock pidfile %s, %s.\n", pidfile, strerror(errno)); + char errStr[1024]; + printf("Can't unlock pidfile %s, %s.\n", pidfile, strerror_r(errno, errStr, sizeof(errStr))); close(fd); return 0; } |