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:
11
namespaces.c
11
namespaces.c
@@ -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);
|
||||
|
Reference in New Issue
Block a user