summaryrefslogtreecommitdiffstats
path: root/pidfile.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-12-03 13:53:05 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-12-03 13:53:05 +0000
commit1c3baa7191e5598c9ea082ba2f1d827559909e67 (patch)
treefda07497530c89737a6f5beb836fd8845b7d4029 /pidfile.c
parent2b5e4d68ed1e45b3732e53ee382161c8150dddce (diff)
downloadrsyslog-1c3baa7191e5598c9ea082ba2f1d827559909e67.tar.gz
rsyslog-1c3baa7191e5598c9ea082ba2f1d827559909e67.tar.xz
rsyslog-1c3baa7191e5598c9ea082ba2f1d827559909e67.zip
added Bartosz Kuzma patches for better compatibility with NetBSD - many
thanks for them!
Diffstat (limited to 'pidfile.c')
-rw-r--r--pidfile.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pidfile.c b/pidfile.c
index d2cd230f..e153a4ed 100644
--- a/pidfile.c
+++ b/pidfile.c
@@ -119,8 +119,9 @@ int write_pid (char *pidfile)
pid = getpid();
if (!fprintf(f,"%d\n", pid)) {
- char errStr[1024];
- printf("Can't write pid , %s.\n", strerror_r(errno, errStr, sizeof(errStr)));
+ char errStr[1024];
+ strerror_r(errno, errStr, sizeof(errStr));
+ printf("Can't write pid , %s.\n", errStr);
close(fd);
return 0;
}
@@ -128,8 +129,9 @@ int write_pid (char *pidfile)
#ifndef __sun
if (flock(fd, LOCK_UN) == -1) {
- char errStr[1024];
- printf("Can't unlock pidfile %s, %s.\n", pidfile, strerror_r(errno, errStr, sizeof(errStr)));
+ char errStr[1024];
+ strerror_r(errno, errStr, sizeof(errStr));
+ printf("Can't unlock pidfile %s, %s.\n", pidfile, errStr);
close(fd);
return 0;
}