overlay interface file descriptors now marked close-on-exec so that

if we get a sigabort or segmentation violation and restart ourselves,
we don't wind up with stuck/lost sockets.
This commit is contained in:
gardners 2012-02-23 11:57:46 +10:30
parent 18385fff82
commit 6397fa70d9

View File

@ -189,6 +189,13 @@ int overlay_interface_init_socket(int interface,struct sockaddr_in src_addr,stru
return WHY("Could not create UDP socket for interface");
}
/* Automatically close socket on calls to exec().
This makes life easier when we restart with an exec after receiving
a bad signal. */
fcntl(I(fd), F_SETFL,
fcntl(I(fd), F_GETFL, NULL)|O_CLOEXEC);
src_addr.sin_family = AF_INET;
src_addr.sin_port = htons( I(port) );
/* XXX Is this right? Are we really setting the local side address?