Re: [libvirt PATCH v5 1/7] Add a PCI/PCIe device VPD Parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +    if (VIR_CLOSE(vpdFileFd) < 0) {
> > +        virReportSystemError(errno, _("Unable to close the VPD file, fd: %d"), vpdFileFd);
> > +        return NULL;
> > +    }
>
> This is closing an FD that is owned & passed in by the caller. I'd
> consider that an undesirable pattern. Whomever opens an FD should
> generally take responsiiblity for closing it too, as that gives
> clear semantics on state of the FD, when this method returns an
> error state.

Makes sense, I'll rework it to have the FD closed in caller functions.




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux