From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 26/28] Avoid gcc 5.4 warning -Wunused-result Date: Wed, 14 Sep 2016 10:58:30 -0600 Message-ID: <20160914165830.GE16014@obsidianresearch.com> References: <1473109698-31408-1-git-send-email-jgunthorpe@obsidianresearch.com> <1473109698-31408-27-git-send-email-jgunthorpe@obsidianresearch.com> <3b8df987-b422-a59c-4dc0-8a99524ab45e@dev.mellanox.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <3b8df987-b422-a59c-4dc0-8a99524ab45e-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Yishai Hadas Cc: Doug Ledford , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Devesh Sharma , Hal Rosenstock , Mike Marciniszyn , Moni Shoua , Sean Hefty , Steve Wise , Tatyana Nikolova , Vladimir Sokolovsky , Yishai Hadas List-Id: linux-rdma@vger.kernel.org On Wed, Sep 14, 2016 at 07:35:42PM +0300, Yishai Hadas wrote: > >+ if (read(sockfd, msg, sizeof msg) != sizeof msg || > >+ write(sockfd, "done", sizeof "done") != sizeof "done") { > >+ perror("client read/write"); > >+ fprintf(stderr, "Couldn't read/write remote address\n"); > > It's just an example, however, better to have an accurate error message and > separate into 2 stubs. There is no value to the user in distinguishing the two cases. They both mean the socket closed unexpectedly. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html