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

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

 



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

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