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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 14, 2016 at 10:58:30AM -0600, Jason Gunthorpe wrote:
> 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.

Agree, it will give nothing to the user. We are all treating pingpong
applications very similar - works/doesn't work, while "doesn't work"
actually says that something very basic is broken.

>
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux