summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/echo_srv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/echo_srv.c b/tests/echo_srv.c
index 01e3325..93778f2 100644
--- a/tests/echo_srv.c
+++ b/tests/echo_srv.c
@@ -920,7 +920,9 @@ int main(int argc, char **argv)
}
echo(sock, &opts);
- close(sock);
+ if (sock >= 0) {
+ close(sock);
+ }
if (opts.daemon && opts.pidfile != NULL) {
unlink(opts.pidfile);