This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 1/3] support: Add support_process_state_wait


* Adhemerval Zanella:

> On 18/02/2020 14:54, Florian Weimer wrote:
>> * Adhemerval Zanella:
>> 
>>>> I think it would be clearer to use ferror to check for errors.
>>>
>>> Maybe: 
>>>
>>>    if (ret == -1 || ferror (stream))
>>>      ...
>>>
>>> ?
>> 
>> I think you might get ret == -1 on EOF, too.
>
> Indeed, so:
>
>   if (!feof (stream) && ferror (stream))
>     FAIL_EXIT1 ("getline failed: %m");
>
> Should cover it.

Yes, I think so.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]