[PATCHv3 07/11] tools/scotest: Fix double close socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

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 bd65034..d033ae0 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);
 			}
 		}
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux