diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-05-03 07:01:41 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-05-03 07:01:41 +0000 |
commit | 87d893c04bcf4752999365e4e172c0c160d8fe39 (patch) | |
tree | a113bb7c82ba52afd452f84c7c3cf3cbac1619c7 | |
parent | 6689140597d1060fb4a152bec229edc66ef3d469 (diff) | |
download | busybox-w32-87d893c04bcf4752999365e4e172c0c160d8fe39.tar.gz busybox-w32-87d893c04bcf4752999365e4e172c0c160d8fe39.tar.bz2 busybox-w32-87d893c04bcf4752999365e4e172c0c160d8fe39.zip |
devfs does not support creation of regular files. So change the
test a bit so as to not possibly create a regular file.
-Erik
-rw-r--r-- | sysklogd/syslogd.c | 9 | ||||
-rw-r--r-- | syslogd.c | 9 |
2 files changed, 6 insertions, 12 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) | |||
494 | alarm (MarkInterval); | 494 | alarm (MarkInterval); |
495 | 495 | ||
496 | /* Create the syslog file so realpath() can work. */ | 496 | /* Create the syslog file so realpath() can work. */ |
497 | close (open (_PATH_LOG, O_RDWR | O_CREAT, 0644)); | 497 | if (realpath (_PATH_LOG, lfile) != NULL) |
498 | if (realpath (_PATH_LOG, lfile) == NULL) | 498 | unlink (lfile); |
499 | perror_msg_and_die ("Could not resolve path to " _PATH_LOG); | ||
500 | |||
501 | unlink (lfile); | ||
502 | 499 | ||
503 | memset (&sunx, 0, sizeof (sunx)); | 500 | memset (&sunx, 0, sizeof (sunx)); |
504 | sunx.sun_family = AF_UNIX; | 501 | sunx.sun_family = AF_UNIX; |
505 | strncpy (sunx.sun_path, lfile, sizeof (sunx.sun_path)); | 502 | strncpy (sunx.sun_path, lfile, sizeof (sunx.sun_path)); |
506 | if ((sock_fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) | 503 | if ((sock_fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) |
507 | perror_msg_and_die ("Couldn't obtain descriptor for socket " _PATH_LOG); | 504 | perror_msg_and_die ("Couldn't get file descriptor for socket " _PATH_LOG); |
508 | 505 | ||
509 | addrLength = sizeof (sunx.sun_family) + strlen (sunx.sun_path); | 506 | addrLength = sizeof (sunx.sun_family) + strlen (sunx.sun_path); |
510 | if ((bind (sock_fd, (struct sockaddr *) &sunx, addrLength)) || (listen (sock_fd, 5))) | 507 | if ((bind (sock_fd, (struct sockaddr *) &sunx, addrLength)) || (listen (sock_fd, 5))) |
@@ -494,17 +494,14 @@ static void doSyslogd (void) | |||
494 | alarm (MarkInterval); | 494 | alarm (MarkInterval); |
495 | 495 | ||
496 | /* Create the syslog file so realpath() can work. */ | 496 | /* Create the syslog file so realpath() can work. */ |
497 | close (open (_PATH_LOG, O_RDWR | O_CREAT, 0644)); | 497 | if (realpath (_PATH_LOG, lfile) != NULL) |
498 | if (realpath (_PATH_LOG, lfile) == NULL) | 498 | unlink (lfile); |
499 | perror_msg_and_die ("Could not resolve path to " _PATH_LOG); | ||
500 | |||
501 | unlink (lfile); | ||
502 | 499 | ||
503 | memset (&sunx, 0, sizeof (sunx)); | 500 | memset (&sunx, 0, sizeof (sunx)); |
504 | sunx.sun_family = AF_UNIX; | 501 | sunx.sun_family = AF_UNIX; |
505 | strncpy (sunx.sun_path, lfile, sizeof (sunx.sun_path)); | 502 | strncpy (sunx.sun_path, lfile, sizeof (sunx.sun_path)); |
506 | if ((sock_fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) | 503 | if ((sock_fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) |
507 | perror_msg_and_die ("Couldn't obtain descriptor for socket " _PATH_LOG); | 504 | perror_msg_and_die ("Couldn't get file descriptor for socket " _PATH_LOG); |
508 | 505 | ||
509 | addrLength = sizeof (sunx.sun_family) + strlen (sunx.sun_path); | 506 | addrLength = sizeof (sunx.sun_family) + strlen (sunx.sun_path); |
510 | if ((bind (sock_fd, (struct sockaddr *) &sunx, addrLength)) || (listen (sock_fd, 5))) | 507 | if ((bind (sock_fd, (struct sockaddr *) &sunx, addrLength)) || (listen (sock_fd, 5))) |