Commit 928db333 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

parse_pid_stat(): minor optimization

Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent faf07489
......@@ -622,12 +622,11 @@ int parse_pid_stat(pid_t pid, struct proc_pid_stat *s)
return -1;
n = read(fd, buf, BUF_SIZE);
close(fd);
if (n < 1) {
pr_err("stat for %d is corrupted\n", pid);
close(fd);
return -1;
}
close(fd);
memset(s, 0, sizeof(*s));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment