introduce and use close_on_exec_on(fd). -50 bytes.

This commit is contained in:
Denis Vlasenko
2007-09-30 23:50:48 +00:00
parent deabacdf91
commit 96e1b38586
14 changed files with 41 additions and 43 deletions

View File

@ -113,7 +113,7 @@ int nc_main(int argc, char **argv)
lport = get_nport(&lsa->sa);
fdprintf(2, "%d\n", ntohs(lport));
}
fcntl(sfd, F_SETFD, FD_CLOEXEC);
close_on_exec_on(sfd);
accept_again:
cfd = accept(sfd, NULL, 0);
if (cfd < 0)