mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
lxc: fuse: Unindent meminfo logic
Reverse the conditional at the start so we aren't stuffing all the logic in an 'if' block
This commit is contained in:
parent
daeace5c5d
commit
f65dcfcd14
@ -161,7 +161,8 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def,
|
|||||||
res = -1;
|
res = -1;
|
||||||
while (copied < size && getline(&line, &n, fd) > 0) {
|
while (copied < size && getline(&line, &n, fd) > 0) {
|
||||||
char *ptr = strchr(line, ':');
|
char *ptr = strchr(line, ':');
|
||||||
if (ptr) {
|
if (!ptr)
|
||||||
|
continue;
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
|
||||||
if (STREQ(line, "MemTotal") &&
|
if (STREQ(line, "MemTotal") &&
|
||||||
@ -223,7 +224,6 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def,
|
|||||||
if (copied > size)
|
if (copied > size)
|
||||||
copied = size;
|
copied = size;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
res = copied;
|
res = copied;
|
||||||
memcpy(buf, virBufferCurrentContent(new_meminfo), copied);
|
memcpy(buf, virBufferCurrentContent(new_meminfo), copied);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user