From 41e4eb34e76ac2594861f93b6bb3dc25ec614dd3 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sun, 19 Sep 2004 00:21:28 +0000 Subject: Close file descriptors on exec --- common/spio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/spio.c') diff --git a/common/spio.c b/common/spio.c index 8cd315b..91e2da0 100644 --- a/common/spio.c +++ b/common/spio.c @@ -125,6 +125,8 @@ int spio_connect(spctx_t* ctx, spio_t* io, const struct sockaddr_any* sany, setsockopt(io->fd, SOL_SOCKET, SO_SNDTIMEO, &(g_state.timeout), sizeof(g_state.timeout)) == -1) sp_messagex(ctx, LOG_WARNING, "couldn't set timeouts on connection"); + fcntl(io->fd, F_SETFD, fcntl(io->fd, F_GETFD, 0) | FD_CLOEXEC); + if(connect(io->fd, &SANY_ADDR(*sany), SANY_LEN(*sany)) == -1) RETURN(-1); -- cgit v1.2.3