Thread (1 message) 1 message, 1 author, 2016-09-14

Re: [PATCH 26/28] Avoid gcc 5.4 warning -Wunused-result

From: Jason Gunthorpe <hidden>
Date: 2016-09-14 16:58:30

On Wed, Sep 14, 2016 at 07:35:42PM +0300, Yishai Hadas wrote:
quoted
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help