]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: close unused fd opened by socketpair
authorDaiki Ueno <ueno@gnu.org>
Wed, 3 Feb 2021 15:05:22 +0000 (16:05 +0100)
committerDaiki Ueno <ueno@gnu.org>
Thu, 4 Feb 2021 08:25:00 +0000 (09:25 +0100)
Otherwise the tests block forever, even if the child exits.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
tests/resume-with-previous-stek.c
tests/resume-with-stek-expiration.c

index 05c1c90868dbe7cff2da7601f29718ba35daeeef..3bbba8f89604534e79559e65292ffd092ac9da52 100644 (file)
@@ -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);
        }
index 80445d64d022d3dba8d9361f3c41869e1be24277..de0f07012b14771b47e9e88424619456c30dcbe5 100644 (file)
@@ -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);
        }