2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-02 07:15:31 +00:00

ns: Don't do manual lookup_ns_by_id

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2014-11-07 20:26:04 +04:00
parent ba983f9819
commit 1283921d53

View File

@@ -148,12 +148,11 @@ int rst_add_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd)
{ {
struct ns_id *nsid; struct ns_id *nsid;
for (nsid = ns_ids; nsid != NULL; nsid = nsid->next) { nsid = lookup_ns_by_id(id, nd);
if (nsid->id == id) { if (nsid) {
if (pid_rst_prio(pid, nsid->pid)) if (pid_rst_prio(pid, nsid->pid))
nsid->pid = pid; nsid->pid = pid;
return 0; return 0;
}
} }
nsid = rst_new_ns_id(id, pid, nd); nsid = rst_new_ns_id(id, pid, nd);