[libvirt] [PATCH 09/12] Set errno on OOM in lxcProcReadMeminfo

Ján Tomko jtomko at redhat.com
Wed Jul 2 10:11:02 UTC 2014


It sets the errno on all other errors, do it here too.
Also report an error.
---
 src/lxc/lxc_fuse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index ee1561c..a3a1275 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -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)
-- 
1.8.5.5




More information about the libvir-list mailing list