2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +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;
for (nsid = ns_ids; nsid != NULL; nsid = nsid->next) {
if (nsid->id == id) {
if (pid_rst_prio(pid, nsid->pid))
nsid->pid = pid;
return 0;
}
nsid = lookup_ns_by_id(id, nd);
if (nsid) {
if (pid_rst_prio(pid, nsid->pid))
nsid->pid = pid;
return 0;
}
nsid = rst_new_ns_id(id, pid, nd);