[systemd-devel] [PATCH] ask-password-api.c: fix assigned but not read warning

Daniel Buch boogiewasthere at gmail.com
Thu Jun 26 05:13:43 PDT 2014


You are right! Sorry for the confusion


2014-06-26 14:04 GMT+02:00 Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>:

> On Thu, Jun 26, 2014 at 01:49:56PM +0200, Daniel Buch wrote:
> > Well we assign fd to be -1 above signalfd() and afterwards never read it.
> > That's what my compiler complained about.
> >
> > Thinking further i guess its the assignment thats redundant since cleanup
> > attribute calls safe_close() that basiclly assigns fd to be -1.
> No, it's not redundant. If it wasn't assigned to -1, it would be closed on
> the
> exit from function, resultin in a double close, the first time when f is
> destroyed.
>
> > I got, gcc version 4.9.0 20140604 (prerelease) (GCC)
> You might want to report this as a regression then, I don't think we had
> this warning before.
>
> Zbyszek
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140626/aba15a09/attachment.html>


More information about the systemd-devel mailing list