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
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 9f1dc99..f5eb4d1 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -452,7 +452,7 @@
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.