[systemd-devel] [PATCH] socket-proxyd: Unchecked return value from library

Susant Sahani susant at redhat.com
Fri Sep 19 01:28:12 PDT 2014


On 09/19/2014 01:35 PM, David Herrmann wrote:
> Hi

Hi,
>
> On Fri, Sep 19, 2014 at 9:57 AM, Susant Sahani <susant at redhat.com> wrote:
>> CID 1237543 (#1 of 1): Unchecked return value from library
>> (CHECKED_RETURN)
>> ---
>>   src/socket-proxy/socket-proxyd.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
>> index ff2b24f..7b0714d 100644
>> --- a/src/socket-proxy/socket-proxyd.c
>> +++ b/src/socket-proxy/socket-proxyd.c
>> @@ -125,7 +125,11 @@ static int connection_create_pipes(Connection *c, int buffer[2], size_t *sz) {
>>                   return -errno;
>>           }
>>
>> -        fcntl(buffer[0], F_SETPIPE_SZ, BUFFER_SIZE);
>> +        r = fcntl(buffer[0], F_SETPIPE_SZ, BUFFER_SIZE);
>> +        if (r < 0) {
>> +                log_error("Failed to set pipe buffer size: %m");
>> +                return -errno;
>> +        }
>
> I don't think that's right. Ignoring the return value of that fcntl is
> just fine. We read the buffer-size afterwards, so if it failed, we
> still continue properly. See fcntl(2) for a bunch of errors that might

Well I think set and get are two operations. for example let's say set 
failed but get success.
setting BUFFER_SIZE failed and in this case buf size is remained as 
default pipe size.

> happen and really shouldn't be fatal nor cause log-messages (like
> EBUSY if we try to _reduce_ the buffer size).
>
> Thanks
> David

Susant


More information about the systemd-devel mailing list