[CRIU] [PATCH] tty: Drop tty_lookup_task_sid helper

Cyrill Gorcunov gorcunov at openvz.org
Tue Oct 30 10:42:38 EDT 2012


It's almost the same as find_first_sid, lets use
it instead.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 tty.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/tty.c b/tty.c
index f087ba8..ba8a6c1 100644
--- a/tty.c
+++ b/tty.c
@@ -686,18 +686,6 @@ static struct pstree_item *find_first_sid(int sid)
 	return NULL;
 }
 
-static struct pstree_item *tty_lookup_task_sid(struct tty_info *info)
-{
-	struct pstree_item *item;
-
-	for_each_pstree_item(item) {
-		if (item->sid == info->tie->sid)
-			return item;
-	}
-
-	return NULL;
-}
-
 static int tty_find_restoring_task(struct tty_info *info)
 {
 	struct pstree_item *item;
@@ -745,7 +733,7 @@ static int tty_find_restoring_task(struct tty_info *info)
 				return 0;
 		}
 
-		item = tty_lookup_task_sid(info);
+		item = find_first_sid(info->tie->sid);
 		if (item) {
 			pr_info("Set a control terminal %x to %d\n",
 				info->tfe->id, info->tie->sid);
-- 
1.7.7.6



More information about the CRIU mailing list