#include <cstring>
#include <unistd.h>
+#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
exit (EXIT_FAILURE);
}
+ fcntl (fd, F_SETFD, FD_CLOEXEC);
+
sockaddr_un sa;
sa.sun_family = AF_UNIX;
int fd2 = accept (fd, 0, 0);
if (fd2 >= 0)
- new server (fd2);
+ {
+ fcntl (fd2, F_SETFD, FD_CLOEXEC);
+ new server (fd2);
+ }
}
void server::log_msg (const char *msg)