summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko2007-05-24 12:19:56 +0000
committerDenis Vlasenko2007-05-24 12:19:56 +0000
commit0fe67b16ce7ba3d5aa0f405bf3c2541210bb5320 (patch)
treeedaab5604e9ca3491eb1c55c878eacccf0cfd41d /networking
parentb055001b6a69cf8fd513d36622cf693ee20c0e92 (diff)
downloadbusybox-0fe67b16ce7ba3d5aa0f405bf3c2541210bb5320.zip
busybox-0fe67b16ce7ba3d5aa0f405bf3c2541210bb5320.tar.gz
udhcp: socketpair can fail if AF_UNIX is not available (e.g. if module is not loaded).
Error out on that.
Diffstat (limited to 'networking')
-rw-r--r--networking/udhcp/signalpipe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/networking/udhcp/signalpipe.c b/networking/udhcp/signalpipe.c
index 3615965..d52a931 100644
--- a/networking/udhcp/signalpipe.c
+++ b/networking/udhcp/signalpipe.c
@@ -36,7 +36,9 @@ static void signal_handler(int sig)
* and installs the signal handler */
void udhcp_sp_setup(void)
{
- socketpair(AF_UNIX, SOCK_STREAM, 0, signal_pipe);
+// BTW, why socketpair and not just pipe?
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, signal_pipe))
+ bb_perror_msg_and_die("socketpair");
fcntl(signal_pipe[0], F_SETFD, FD_CLOEXEC);
fcntl(signal_pipe[1], F_SETFD, FD_CLOEXEC);
signal(SIGUSR1, signal_handler);