From 833b4dd623e0fda402ee8f4da8316ef31f5b96b1 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Tue, 29 Jul 2014 17:20:56 +0300 Subject: [PATCH] tools/scotest: Fix double close socket When executing in a child we close(sk) in the beginning. error label handles parent process error conditions. --- tools/scotest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/scotest.c b/tools/scotest.c index bd650345f..d033ae0b8 100644 --- a/tools/scotest.c +++ b/tools/scotest.c @@ -210,7 +210,7 @@ static void do_listen(void (*handler)(int sk)) strerror(errno), errno); if (!defer_setup) { close(nsk); - goto error; + exit(1); } } @@ -227,7 +227,7 @@ static void do_listen(void (*handler)(int sk)) if (defer_setup < 0) { close(nsk); - goto error; + exit(1); } } -- 2.47.3