Commit 6701296f authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

dump: Be ready for absence of output from /proc/pid/children

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent afe52e42
...@@ -757,10 +757,14 @@ static int parse_children(pid_t pid, u32 *nr_children, u32 **children) ...@@ -757,10 +757,14 @@ static int parse_children(pid_t pid, u32 *nr_children, u32 **children)
goto err; goto err;
} }
if (!(fgets(loc_buf, sizeof(loc_buf), file))) { /*
pr_perror("Can't read %d children content", pid); * FIXME: The format of "children" output is not
goto err_close; * yet stable enough so be ready to get nothing.
} * Moreover, at moment number of children limited
* by the size of a buffer. We need while() here.
*/
if (!(fgets(loc_buf, sizeof(loc_buf), file)))
loc_buf[0] = 0;
fclose(file); fclose(file);
......
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