]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: More SIGPIPE treatment as error
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 16 Nov 2022 00:38:54 +0000 (00:38 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 16 Nov 2022 00:49:32 +0000 (00:49 +0000)
81f8d97b3486 ("tests: treat all signals as error") turned some SIGPIPE signals
to EPIPE, but missed tests/mini-dtls-mtu.c.

During

gnutls_bye(session, GNUTLS_SHUT_WR),

on Linux we get

client|<11>| WRITE: enqueued 39 bytes for 0x3. Total 39 bytes.
client|<11>| WRITE FLUSH: 39 bytes in buffer.
client|<2>| WRITE: -1 returned from 0x3, errno: 111
(ECONNREFUSED)

but on GNU/Hurd a SIGPIPE is sent instead of returning of ECONNREFUSED.
We thus need to turn it into an error to correctly interpret the test
result.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
tests/mini-dtls-mtu.c

index d48c328a07638dfdc451eec1a16e7fbc7aed6b11..7407398ed24a0015446f1c6bf00cf407a6d05166 100644 (file)
@@ -284,6 +284,8 @@ void doit(void)
        int fd[2];
        int err;
 
+       signal(SIGPIPE, SIG_IGN);
+
        err = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
        if (err == -1) {
                perror("socketpair");