#include "dccp.h"
#include "error.h"
#include "string.h"
+#include "fd.h"
+#include "close_on_fork.h"
#include "server.cmdline.h"
extern struct gengetopt_args_info conf;
/** the list of connected clients **/
PARA_NOTICE_LOG("connection from %s\n", inet_ntoa(dc->addr.sin_addr));
dc->fd = ret;
list_add(&dc->node, &clients);
+ add_close_on_fork_list(dc->fd);
+ mark_fd_nonblock(dc->fd);
}
static int dccp_open(void)
if (ret < 0)
return -E_DCCP_LISTEN;
PARA_DEBUG_LOG("listening on fd %d\n", listen_fd);
+ add_close_on_fork_list(listen_fd);
+ mark_fd_nonblock(listen_fd);
return 1;
}
PARA_DEBUG_LOG("shutting down %s (fd %d)\n", inet_ntoa(dc->addr.sin_addr),
dc->fd);
close(dc->fd);
+ del_close_on_fork_list(dc->fd);
list_del(&dc->node);
free(dc);
}