diff options
author | Daiki Ueno <ueno@gnu.org> | 2021-02-03 16:05:22 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2021-02-04 09:25:00 +0100 |
commit | 37e54a05221e076ba905d2d53fc7d885dc9e9ebc (patch) | |
tree | 21f82aeab826378ce92e0b113bda15c5d7341a6d | |
parent | 8bd9fe1dc2219c168dd720d5d99d8675cb299b29 (diff) | |
download | gnutls-37e54a05221e076ba905d2d53fc7d885dc9e9ebc.tar.gz |
tests: close unused fd opened by socketpair
Otherwise the tests block forever, even if the child exits.
Signed-off-by: Daiki Ueno <ueno@gnu.org>
-rw-r--r-- | tests/resume-with-previous-stek.c | 2 | ||||
-rw-r--r-- | tests/resume-with-stek-expiration.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/resume-with-previous-stek.c b/tests/resume-with-previous-stek.c index 05c1c90868..3bbba8f896 100644 --- a/tests/resume-with-previous-stek.c +++ b/tests/resume-with-previous-stek.c @@ -227,11 +227,13 @@ static void run(const char *name, const char *prio, int resume[], int rounds) if (child) { /* We are the parent */ + close(sockets[1]); server(sockets[0], rounds, prio); waitpid(child, &status, 0); check_wait_status(status); } else { /* We are the child */ + close(sockets[0]); client(sockets[1], resume, rounds, prio); exit(0); } diff --git a/tests/resume-with-stek-expiration.c b/tests/resume-with-stek-expiration.c index 80445d64d0..de0f07012b 100644 --- a/tests/resume-with-stek-expiration.c +++ b/tests/resume-with-stek-expiration.c @@ -297,11 +297,13 @@ static void run(const char *name, const char *prio, int resumption_should_succee if (child) { /* We are the parent */ + close(sockets[1]); server(sockets[0], resumption_should_succeed, rounds, prio); waitpid(child, &status, 0); check_wait_status(status); } else { /* We are the child */ + close(sockets[0]); client(sockets[1], resumption_should_succeed, rounds, prio); exit(0); } |