Re: [PATCH] cgroup: preserve correct errno on failure

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

 



On Tue, Feb 15, 2011 at 05:33:09PM -0700, Eric Blake wrote:
> On 02/15/2011 05:01 PM, Eric Blake wrote:
> > * src/util/cgroup.c (virCgroupSetValueStr, virCgroupGetValueStr)
> > (virCgroupRemoveRecursively): VIR_DEBUG can clobber errno.
> > (virCgroupRemove): Use VIR_DEBUG rather than DEBUG.
> > ---
> 
> >      rc = virFileWriteStr(keypath, value, 0);
> >      if (rc < 0) {
> > -        DEBUG("Failed to write value '%s': %m", value);
> >          rc = -errno;
> > +        VIR_DEBUG("Failed to write value '%s': %m", value);
> 
> Should we go one step further and guarantee that VIR_DEBUG() does not
> modify errno?

  We should probably do this, basically in virLogMessage() save and restore
errno so that even INFO or WARN don't change it if activated, but I would
do this as a post 0.8.8 :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]