unix: Use helper to search for task

Submitted by Pavel Emelianov on May 13, 2016, 1:33 p.m.

Details

Message ID 5735D7C2.4040404@virtuozzo.com
State Accepted
Series "unix: Use helper to search for task"
Commit 8cbd93b4e5028e1af7a6ada52228f730f118e790
Headers show

Commit Message

Pavel Emelianov May 13, 2016, 1:33 p.m.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/sk-unix.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 1396d76..e18480d 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -186,10 +186,7 @@  static int resolve_rel_name(struct unix_sk_desc *sk, const struct fd_parms *p)
 	int mntns_root, i;
 	struct ns_id *ns;
 
-	for_each_pstree_item(task) {
-		if (task->pid.real == p->pid)
-			break;
-	}
+	task = pstree_item_by_real(p->pid);
 	if (!task) {
 		pr_err("Can't find task with pid %d\n", p->pid);
 		return -ENOENT;