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:
Cole Robinson 2016-01-21 13:06:03 -05:00
parent daeace5c5d
commit f65dcfcd14

View File

@ -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);