From f413620c5f66462498c89533ca868332df7a83b5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Nov 2013 18:48:43 +0100 Subject: [PATCH] child: check return code of socket_blocking for accept in child_main Signed-off-by: Michael Adam (cherry picked from commit 198600ce42d16b1ba43605ff66585a3aa8853581) --- src/child.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/child.c b/src/child.c index 01ef178..033885f 100644 --- a/src/child.c +++ b/src/child.c @@ -253,7 +253,13 @@ static void child_main (struct child_s *ptr) continue; } - socket_blocking(listenfd); + ret = socket_blocking(listenfd); + if (ret != 0) { + log_message(LOG_ERR, "Failed to set listening " + "socket %d to blocking for accept: %s", + listenfd, strerror(errno)); + exit(1); + } /* * We have a socket that is readable.