]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: ignore SIGPIPE in forking tests if the parent is TLS client
authorDaiki Ueno <ueno@gnu.org>
Mon, 28 Aug 2023 06:47:04 +0000 (15:47 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 28 Aug 2023 06:47:04 +0000 (15:47 +0900)
If the tests are forking and the parent process is a client, care must
be taken to handle SIGPIPE reported by the child process (server) when
the client closes the connection.

This hadn't been exposed until commit
dd79ac9bcf90012e090726adf7c1940bcce8333f, thanks to the fact that the
parent process kept the other pipe end which effectively prevented a
"broken pipe".

Signed-off-by: Daiki Ueno <ueno@gnu.org>
tests/mini-tls-nonblock.c
tests/srp.c

index 853f841fbde5e7d35cec721d9019693b2de3ad8c..fae9b443219e28576e2ed35e308956698d764503 100644 (file)
@@ -287,6 +287,8 @@ static void start(const char *msg, const char *prio, unsigned expl)
 
        success("trying %s\n", msg);
 
+       signal(SIGPIPE, SIG_IGN);
+
        ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
        if (ret < 0) {
                perror("socketpair");
index d2b06895539e327d6b500f5262b2a44e976b3872..4a9c00b5b8a45c3c3820d5d50b70119d9448e354 100644 (file)
@@ -271,6 +271,9 @@ static void start(const char *name, const char *prio, const char *user,
        int ret;
 
        success("testing: %s\n", name);
+
+       signal(SIGPIPE, SIG_IGN);
+
        ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
        if (ret < 0) {
                perror("socketpair");