summaryrefslogtreecommitdiff
path: root/tools/scotest.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-07-29 17:20:56 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2014-08-01 13:30:31 +0300
commit833b4dd623e0fda402ee8f4da8316ef31f5b96b1 (patch)
tree750a4ff63ec6a6d792800023db68647dd09300bf /tools/scotest.c
parent830c8801ef227f45244cbf47edfe09a8848d43bf (diff)
downloadbluez-833b4dd623e0fda402ee8f4da8316ef31f5b96b1.tar.gz
tools/scotest: Fix double close socket
When executing in a child we close(sk) in the beginning. error label handles parent process error conditions.
Diffstat (limited to 'tools/scotest.c')
-rw-r--r--tools/scotest.c4
1 files 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);
}
}