mirror of
https://github.com/sheumann/hush.git
synced 2024-12-26 10:32:02 +00:00
Joel Coltoff <joel@wmi.com> noticed that following a recent
change in uClibc that changed opening the /dev/log socket as SOCK_STREAM to SOCK_DGRAM, busybox syslogd no longer worked since it needed a matching change. This fixes it so it works once again.
This commit is contained in:
parent
6859d761d3
commit
c59716ff4c
@ -509,11 +509,11 @@ static void doSyslogd (void)
|
|||||||
memset (&sunx, 0, sizeof (sunx));
|
memset (&sunx, 0, sizeof (sunx));
|
||||||
sunx.sun_family = AF_UNIX;
|
sunx.sun_family = AF_UNIX;
|
||||||
strncpy (sunx.sun_path, lfile, sizeof (sunx.sun_path));
|
strncpy (sunx.sun_path, lfile, sizeof (sunx.sun_path));
|
||||||
if ((sock_fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
|
if ((sock_fd = socket (AF_UNIX, SOCK_DGRAM, 0)) < 0)
|
||||||
perror_msg_and_die ("Couldn't get file 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);
|
addrLength = sizeof (sunx.sun_family) + strlen (sunx.sun_path);
|
||||||
if ((bind (sock_fd, (struct sockaddr *) &sunx, addrLength)) || (listen (sock_fd, 5)))
|
if (bind (sock_fd, (struct sockaddr *) &sunx, addrLength) < 0)
|
||||||
perror_msg_and_die ("Could not connect to socket " _PATH_LOG);
|
perror_msg_and_die ("Could not connect to socket " _PATH_LOG);
|
||||||
|
|
||||||
if (chmod (lfile, 0666) < 0)
|
if (chmod (lfile, 0666) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user