On Fri, 25.01.13 13:59, Thomas Jarosch (thomas.jaro...@intra2net.com) wrote:
> Detected by cppcheck. > > Signed-off-by: Thomas Jarosch <thomas.jaro...@intra2net.com> > --- > src/shared/efivars.c | 27 +++++++++++++++++++++------ > 1 file changed, 21 insertions(+), 6 deletions(-) > > diff --git a/src/shared/efivars.c b/src/shared/efivars.c > index d5cb88c..4402aec 100644 > --- a/src/shared/efivars.c > +++ b/src/shared/efivars.c > @@ -53,30 +53,44 @@ int efi_get_variable(sd_id128_t vendor, const char *name, > uint32_t *attribute, v > if (fd < 0) > return -errno; > > - if (fstat(fd, &st) < 0) > + if (fstat(fd, &st) < 0) { > + close_nointr_nofail(fd); I figure cppcheck needs to learn about _cleanup_close_... We use gcc's cleanup attribute logic to close this file. In fact we make use of that quite heavily now for memory and other kind of resourec allocation.... Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel