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

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

 



On 10/10/2016 6:06 AM, Yishai Hadas wrote:
> On 10/10/2016 2:19 AM, Jason Gunthorpe wrote:
>> On Sun, Oct 09, 2016 at 04:31:17PM +0300, Yishai Hadas wrote:
>>
>>>> -    if (write(connfd, msg, sizeof msg) != sizeof msg) {
>>>> -        fprintf(stderr, "Couldn't send local address\n");
>>>> +    if (write(connfd, msg, sizeof msg) != sizeof msg ||
>>>> +        read(connfd, msg, sizeof msg) != sizeof msg) {
>>>> +        fprintf(stderr, "Couldn't send/recv local address\n");
>>>
>>> At that step the server expects to read a "done" response from its
>>> client,
>>> checking whether the read was done for sizeof msg which is much
>>> larger will
>>> fail.
>>
>> This OK?
> 
> Yes, below patch solves the issue.

Merged, thanks.


-- 
Doug Ledford <dledford@xxxxxxxxxx>
    GPG Key ID: 0E572FDD

Attachment: signature.asc
Description: OpenPGP digital 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