- reaper_busy was off by a factor of 10 (possibly originally
for precision?)
- get_pid1_time was expecting a '1' byte like in
the pid_to/from_ns_wrapper functions instead of reading its
value which is what is actually written
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
ret = select(cpipe[0]+1, &s, NULL, NULL, &tv);
if (ret <= 0)
goto fail;
- ret = read(cpipe[0], &v, 1);
- if (ret != sizeof(char) || v != '1') {
+ ret = read(cpipe[0], &v, sizeof(v));
+ if (ret != sizeof(v))
goto fail;
- }
wait_for_pid(cpid);
if (!cgfs_get_value("cpuacct", cgroup, "cpuacct.usage", &usage_str))
goto out;
usage = strtoul(usage_str, NULL, 10);
- usage /= 100000000;
+ usage /= 1000000000;
out:
free(cgroup);