Displaying 1 result from an estimated 1 matches for "test_stream_check_sigpip".
Did you mean:
test_stream_check_sigpipe
2023 Aug 31
0
[RFC PATCH v2 2/2] test/vsock: shutdowned socket test
...t;@@ -1170,6 +1171,133 @@ static void test_seqpacket_msg_peek_server(const struct test_opts *opts)
> return test_msg_peek_server(opts, true);
> }
>
>+static sig_atomic_t have_sigpipe;
>+
>+static void sigpipe(int signo)
>+{
>+ have_sigpipe = 1;
>+}
>+
>+static void test_stream_check_sigpipe(int fd)
>+{
>+ ssize_t res;
>+
>+ have_sigpipe = 0;
>+
>+ res = send(fd, "A", 1, 0);
>+ if (res != -1) {
>+ fprintf(stderr, "expected send(2) failure, got %zi\n", res);
>+ exit(EXIT_FAILURE);
>+ }
>+
>+ if (!have_sigpipe) {
>+ fprintf(s...