X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/secnet/blobdiff_plain/5d8fc5c038cb1e4a213e5d0283ebfc5c853ac04f..4fb0f88d53fc60395a4a87b7a9ca1245ba033ee7:/udp.c?ds=inline diff --git a/udp.c b/udp.c index 552a58e..bb82026 100644 --- a/udp.c +++ b/udp.c @@ -224,10 +224,7 @@ static void udp_phase_hook(void *sst, uint32_t new_phase) fatal_perror("udp (%s:%d): fcntl(set O_NONBLOCK)", st->loc.file,st->loc.line); } - if (fcntl(st->fd, F_SETFD, FD_CLOEXEC)==-1) { - fatal_perror("udp (%s:%d): fcntl(set FD_CLOEXEC)", - st->loc.file,st->loc.line); - } + setcloexec(st->fd); FILLZERO(addr); addr.sin_family=AF_INET;