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

Eric Blake eblake at redhat.com
Wed Feb 16 00:33:09 UTC 2011


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?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110215/7fdde2e5/attachment-0001.sig>


More information about the libvir-list mailing list