From 198600ce42d16b1ba43605ff66585a3aa8853581 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Nov 2013 18:48:43 +0100 Subject: child: check return code of socket_blocking for accept in child_main Signed-off-by: Michael Adam --- src/child.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/child.c b/src/child.c index e7e4b35..da82139 100644 --- a/src/child.c +++ b/src/child.c @@ -260,7 +260,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. -- cgit v1.2.3