mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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;
|
||||
while (copied < size && getline(&line, &n, fd) > 0) {
|
||||
char *ptr = strchr(line, ':');
|
||||
if (ptr) {
|
||||
if (!ptr)
|
||||
continue;
|
||||
*ptr = '\0';
|
||||
|
||||
if (STREQ(line, "MemTotal") &&
|
||||
@ -223,7 +224,6 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def,
|
||||
if (copied > size)
|
||||
copied = size;
|
||||
}
|
||||
}
|
||||
res = copied;
|
||||
memcpy(buf, virBufferCurrentContent(new_meminfo), copied);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user