diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-05-24 12:19:56 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-05-24 12:19:56 +0000 |
commit | e245b286f7845887c2f185979e94a1a2f2cfcc75 (patch) | |
tree | edaab5604e9ca3491eb1c55c878eacccf0cfd41d | |
parent | c2d4c5ead87566456782e561c2af076c12efbcd0 (diff) | |
download | busybox-w32-e245b286f7845887c2f185979e94a1a2f2cfcc75.tar.gz busybox-w32-e245b286f7845887c2f185979e94a1a2f2cfcc75.tar.bz2 busybox-w32-e245b286f7845887c2f185979e94a1a2f2cfcc75.zip |
udhcp: socketpair can fail if AF_UNIX is not available (e.g. if module is not loaded).
Error out on that.
git-svn-id: svn://busybox.net/trunk/busybox@18681 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | networking/udhcp/signalpipe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/networking/udhcp/signalpipe.c b/networking/udhcp/signalpipe.c index 361596580..d52a931a9 100644 --- a/networking/udhcp/signalpipe.c +++ b/networking/udhcp/signalpipe.c | |||
@@ -36,7 +36,9 @@ static void signal_handler(int sig) | |||
36 | * and installs the signal handler */ | 36 | * and installs the signal handler */ |
37 | void udhcp_sp_setup(void) | 37 | void udhcp_sp_setup(void) |
38 | { | 38 | { |
39 | socketpair(AF_UNIX, SOCK_STREAM, 0, signal_pipe); | 39 | // BTW, why socketpair and not just pipe? |
40 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, signal_pipe)) | ||
41 | bb_perror_msg_and_die("socketpair"); | ||
40 | fcntl(signal_pipe[0], F_SETFD, FD_CLOEXEC); | 42 | fcntl(signal_pipe[0], F_SETFD, FD_CLOEXEC); |
41 | fcntl(signal_pipe[1], F_SETFD, FD_CLOEXEC); | 43 | fcntl(signal_pipe[1], F_SETFD, FD_CLOEXEC); |
42 | signal(SIGUSR1, signal_handler); | 44 | signal(SIGUSR1, signal_handler); |