vhost: do not generate signal when sendmsg fails
More precisely, do not generate a SIGPIPE signal if the peer has closed the connection. Otherwise, it will terminate the process by default. As a library, we should avoid terminating the application process when error happens and just need to return with an error. Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
parent
71d93e9dd6
commit
7a36967029
@ -174,7 +174,7 @@ send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ret = sendmsg(sockfd, &msgh, 0);
|
ret = sendmsg(sockfd, &msgh, MSG_NOSIGNAL);
|
||||||
} while (ret < 0 && errno == EINTR);
|
} while (ret < 0 && errno == EINTR);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user