]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Set errno on OOM in lxcProcReadMeminfo
authorJán Tomko <jtomko@redhat.com>
Fri, 27 Jun 2014 08:47:05 +0000 (10:47 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 3 Jul 2014 08:48:14 +0000 (10:48 +0200)
It sets the errno on all other errors, do it here too.
Also report an error.

src/lxc/lxc_fuse.c

index ee1561cfc98f179bfad9caf23ea04a46655f2ff8..a3a1275d8e2d5d14f96ff544e4b241653feeab83 100644 (file)
@@ -208,8 +208,10 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def,
                 virBufferAdd(new_meminfo, line, -1);
             }
 
-            if (virBufferError(new_meminfo))
+            if (virBufferCheckError(new_meminfo) < 0) {
+                res = -errno;
                 goto cleanup;
+            }
 
             copied += strlen(line);
             if (copied > size)