aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-03 07:01:41 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-03 07:01:41 +0000
commit87d893c04bcf4752999365e4e172c0c160d8fe39 (patch)
treea113bb7c82ba52afd452f84c7c3cf3cbac1619c7 /sysklogd
parent6689140597d1060fb4a152bec229edc66ef3d469 (diff)
downloadbusybox-87d893c04bcf4752999365e4e172c0c160d8fe39.tar.gz
devfs does not support creation of regular files. So change the
test a bit so as to not possibly create a regular file. -Erik
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/syslogd.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 9f5fc93b1..379efcf51 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -494,17 +494,14 @@ static void doSyslogd (void)
alarm (MarkInterval);
/* Create the syslog file so realpath() can work. */
- close (open (_PATH_LOG, O_RDWR | O_CREAT, 0644));
- if (realpath (_PATH_LOG, lfile) == NULL)
- perror_msg_and_die ("Could not resolve path to " _PATH_LOG);
-
- unlink (lfile);
+ if (realpath (_PATH_LOG, lfile) != NULL)
+ unlink (lfile);
memset (&sunx, 0, sizeof (sunx));
sunx.sun_family = AF_UNIX;
strncpy (sunx.sun_path, lfile, sizeof (sunx.sun_path));
if ((sock_fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
- perror_msg_and_die ("Couldn't obtain descriptor for socket " _PATH_LOG);
+ perror_msg_and_die ("Couldn't get file descriptor for socket " _PATH_LOG);
addrLength = sizeof (sunx.sun_family) + strlen (sunx.sun_path);
if ((bind (sock_fd, (struct sockaddr *) &sunx, addrLength)) || (listen (sock_fd, 5)))