X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=blobdiff_plain;f=udp.c;h=bb82026c144d0df1f56f9f52e9401dd2fae91691;hp=552a58e000d78d372cc5def7de0afa7512785ccb;hb=4fb0f88d53fc60395a4a87b7a9ca1245ba033ee7;hpb=5d8fc5c038cb1e4a213e5d0283ebfc5c853ac04f 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;