diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-30 23:50:48 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-30 23:50:48 +0000 |
commit | 96e1b38586e80a0f014038bf4fdf4689c668fbd6 (patch) | |
tree | d7f6a7866700601598cfcc006b7dcb6cb4a7c07e /networking/udhcp | |
parent | deabacdf91c6d1c3cfcdb4cd06780807193de81d (diff) | |
download | busybox-w32-96e1b38586e80a0f014038bf4fdf4689c668fbd6.tar.gz busybox-w32-96e1b38586e80a0f014038bf4fdf4689c668fbd6.tar.bz2 busybox-w32-96e1b38586e80a0f014038bf4fdf4689c668fbd6.zip |
introduce and use close_on_exec_on(fd). -50 bytes.
Diffstat (limited to 'networking/udhcp')
-rw-r--r-- | networking/udhcp/signalpipe.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/signalpipe.c b/networking/udhcp/signalpipe.c index 9c7ead965..fafd2082a 100644 --- a/networking/udhcp/signalpipe.c +++ b/networking/udhcp/signalpipe.c | |||
@@ -39,9 +39,9 @@ void udhcp_sp_setup(void) | |||
39 | { | 39 | { |
40 | /* was socketpair, but it needs AF_UNIX in kernel */ | 40 | /* was socketpair, but it needs AF_UNIX in kernel */ |
41 | xpipe(signal_pipe); | 41 | xpipe(signal_pipe); |
42 | fcntl(signal_pipe[0], F_SETFD, FD_CLOEXEC); | 42 | close_on_exec_on(signal_pipe[0]); |
43 | fcntl(signal_pipe[1], F_SETFD, FD_CLOEXEC); | 43 | close_on_exec_on(signal_pipe[1]); |
44 | fcntl(signal_pipe[1], F_SETFL, O_NONBLOCK); | 44 | ndelay_on(signal_pipe[1]); |
45 | signal(SIGUSR1, signal_handler); | 45 | signal(SIGUSR1, signal_handler); |
46 | signal(SIGUSR2, signal_handler); | 46 | signal(SIGUSR2, signal_handler); |
47 | signal(SIGTERM, signal_handler); | 47 | signal(SIGTERM, signal_handler); |
@@ -56,7 +56,7 @@ int udhcp_sp_fd_set(fd_set *rfds, int extra_fd) | |||
56 | FD_ZERO(rfds); | 56 | FD_ZERO(rfds); |
57 | FD_SET(signal_pipe[0], rfds); | 57 | FD_SET(signal_pipe[0], rfds); |
58 | if (extra_fd >= 0) { | 58 | if (extra_fd >= 0) { |
59 | fcntl(extra_fd, F_SETFD, FD_CLOEXEC); | 59 | close_on_exec_on(extra_fd); |
60 | FD_SET(extra_fd, rfds); | 60 | FD_SET(extra_fd, rfds); |
61 | } | 61 | } |
62 | return signal_pipe[0] > extra_fd ? signal_pipe[0] : extra_fd; | 62 | return signal_pipe[0] > extra_fd ? signal_pipe[0] : extra_fd; |