mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
devfs does not support creation of regular files. So change the
test a bit so as to not possibly create a regular file. -Erik
This commit is contained in:
parent
6689140597
commit
87d893c04b
@ -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)))
|
||||
|
@ -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)))
|
||||
|
Loading…
Reference in New Issue
Block a user