Commit 69b093ad authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

seize: set cr_errno in collect_pstree

Before cr_errno was called from open_pid_proc(), but
now it isn't called if a root task doesn't exist.

Reported-by: Mr Jenkins
Fixes: b9b0730c ("ptrace: split task_seize into seize_catch_task and seize_wait_task")
Signed-off-by: 's avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 94928cf8
......@@ -9,6 +9,7 @@
#include "compiler.h"
#include "cr_options.h"
#include "cr-errno.h"
#include "pstree.h"
#include "ptrace.h"
#include "seize.h"
......@@ -323,8 +324,10 @@ int collect_pstree(pid_t pid)
root_item->pid.real = pid;
if (seize_catch_task(pid))
if (seize_catch_task(pid)) {
set_cr_errno(ESRCH);
goto err;
}
ret = seize_wait_task(pid, -1, &dmpi(root_item)->pi_creds);
if (ret < 0)
......
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