syslog: Use SOCK_CLOEXEC instead of separate fcntl() call.
This commit is contained in:
parent
975a73b354
commit
0bad71763f
@ -341,9 +341,9 @@ connectlog(void)
|
||||
struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */
|
||||
|
||||
if (LogFile == -1) {
|
||||
if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
|
||||
if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC,
|
||||
0)) == -1)
|
||||
return;
|
||||
(void)_fcntl(LogFile, F_SETFD, FD_CLOEXEC);
|
||||
}
|
||||
if (LogFile != -1 && status == NOCONN) {
|
||||
SyslogAddr.sun_len = sizeof(SyslogAddr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user