vsock: send SIGPIPE on write to shutdowned socket

POSIX requires to send SIGPIPE on write to SOCK_STREAM socket which was
shutdowned with SHUT_WR flag or its peer was shutdowned with SHUT_RD
flag. Also we must not send SIGPIPE if MSG_NOSIGNAL flag is set.

Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Arseniy Krasnov 2023-09-11 23:20:26 +03:00 committed by Paolo Abeni
parent ca5ab9638e
commit 8ecf0cedc0

View File

@ -1921,6 +1921,9 @@ out_err:
err = total_written;
}
out:
if (sk->sk_type == SOCK_STREAM)
err = sk_stream_error(sk, msg->msg_flags, err);
release_sock(sk);
return err;
}