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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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