git.samba.org
/
socket_wrapper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e896cec
)
tests/echo_srv: allow more than once tcp connection at a time
author
Stefan Metzmacher
<metze@samba.org>
Fri, 5 Feb 2021 14:41:27 +0000
(15:41 +0100)
committer
Andreas Schneider
<asn@samba.org>
Mon, 8 Feb 2021 18:29:57 +0000
(19:29 +0100)
We should not wait for the last connection to disconnect,
there would not be any reason to use fork at all.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
tests/echo_srv.c
patch
|
blob
|
history
diff --git
a/tests/echo_srv.c
b/tests/echo_srv.c
index 0aefa9aa9825f76c2e90535a52adc5eba90afc5a..fbb6637a6a9deb4e2778b7952f273fb316b9eae8 100644
(file)
--- a/
tests/echo_srv.c
+++ b/
tests/echo_srv.c
@@
-537,6
+537,7
@@
static void echo_tcp(int sock)
pid_t pid;
while (1) {
+ waitpid(-1, NULL, WNOHANG);
s = accept(sock, &addr.sa.s, &addr.sa_socklen);
if (s == -1 && errno == ECONNABORTED) {
continue;
@@
-575,7
+576,6
@@
static void echo_tcp(int sock)
close(s);
exit(0);
}
- waitpid(-1, NULL, 0);
close(s);
}