From: Ján Tomko Date: Fri, 27 Jun 2014 08:47:05 +0000 (+0200) Subject: Set errno on OOM in lxcProcReadMeminfo X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e12b8000c8e5e3c99c9f061316775d1b4ee67d4d;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git Set errno on OOM in lxcProcReadMeminfo It sets the errno on all other errors, do it here too. Also report an error. --- diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index ee1561cfc..a3a1275d8 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)