syslog: Use SOCK_CLOEXEC instead of separate fcntl() call.

This commit is contained in:
jilles 2013-10-20 21:04:44 +00:00
parent 975a73b354
commit 0bad71763f

View File

@ -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);