From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 1/3] vhost: do not generate signal when sendmsg fails Date: Thu, 29 Mar 2018 15:46:03 +0200 Message-ID: <523c173f-aab5-2d91-42dc-0529b88e381b@redhat.com> References: <20180306104327.14470-1-tiwei.bie@intel.com> <20180306104327.14470-2-tiwei.bie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: jianfeng.tan@intel.com, yliu@fridaylinux.org, zhihong.wang@intel.com, xiao.w.wang@intel.com, cunming.liang@intel.com, dan.daly@intel.com To: Tiwei Bie , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id C5A332B82 for ; Thu, 29 Mar 2018 15:46:07 +0200 (CEST) In-Reply-To: <20180306104327.14470-2-tiwei.bie@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/06/2018 11:43 AM, Tiwei Bie wrote: > Signed-off-by: Tiwei Bie > --- > lib/librte_vhost/socket.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c > index 0354740fa..d703d2114 100644 > --- a/lib/librte_vhost/socket.c > +++ b/lib/librte_vhost/socket.c > @@ -181,7 +181,7 @@ send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num) > } > > do { > - ret = sendmsg(sockfd, &msgh, 0); > + ret = sendmsg(sockfd, &msgh, MSG_NOSIGNAL); > } while (ret < 0 && errno == EINTR); > > if (ret < 0) { > Applied to dpdk-next-virtio/master with below commit message ------------------------------------------------------------ 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. ------------------------------------------------------------ Thanks, Maxime