Hi

On Fri, Sep 12, 2014 at 10:39 AM, Philippe De Swert
<philippedesw...@gmail.com> wrote:
> Hi David,
>
> On 11/09/14 18:43, David Herrmann wrote:
>> Hi
>>>  _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
>>>          PROTECT_ERRNO;
>>> -        int fd;
>>> +        _cleanup_close_ int fd = -1;
>>
>> This does not work. "fd" is used to hold the journal fd, but this is a
>> global fd shared between all callers. See journal_fd().
>> coverity might complain about this as we never close the fd. However,
>> that is totally fine as it will get closed on execve() automatically.
>> There is no reason to close it manually.
>
> Good to know. I guess this goes for all journal related files then? So I
> can mark them correctly in Coverity so they will not be detected wrongly
> in the future.

This is an internal detail to journal_send() and friends. Not sure how
verbosely coverity warns about those, but it should be limited to that
file (and callers of journal_fd()).

Thanks
David
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to