diff options
author | Felix Janda <felix.janda at posteo.de> | 2013-08-26 21:55:33 +0200 |
---|---|---|
committer | Felix Janda <felix.janda at posteo.de> | 2013-08-26 21:55:33 +0200 |
commit | dccfb2a9c156d03b6399120ae3dd4b23ff00b43f (patch) | |
tree | 70e18888170c3729bb5fc9a9db8c41bad7e333d6 /lib | |
parent | 8fad256b1956bb478fc416a21573f0dec3bf11c0 (diff) | |
download | toybox-dccfb2a9c156d03b6399120ae3dd4b23ff00b43f.tar.gz |
syslogd: cleanup
- fix bugs introduced in the cleanups
- inline addrfds() and open_unix_socks() and simplify them
- use xpidfile()
- remove isNetwork from struct logfile
- invert the meaning of facility and level in struct logfile so
that they are automatically correctly initialized
- fix memory leak regarding the filenames of logfiles
- TT.sd was unused
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.h | 1 | ||||
-rw-r--r-- | lib/xwrap.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -123,6 +123,7 @@ void xmkpath(char *path, int mode); void xsetuid(uid_t uid); char *xreadlink(char *name); long xparsetime(char *arg, long units, long *fraction); +void xpidfile(char *name); // lib.c void verror_msg(char *msg, int err, va_list va); diff --git a/lib/xwrap.c b/lib/xwrap.c index 9f1dc996..f5eb4d11 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -452,7 +452,7 @@ void xpidfile(char *name) sprintf(pidfile, "/var/run/%s.pid", name); // Try three times to open the sucker. for (i=0; i<3; i++) { - fd = open(pidfile, O_CREAT|O_EXCL, 0644); + fd = open(pidfile, O_CREAT|O_EXCL|O_WRONLY, 0644); if (fd != -1) break; // If it already existed, read it. Loop for race condition. |