2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-02 23:35:21 +00:00

ns: clean up dump_namespaces

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2014-04-18 18:42:51 +04:00
committed by Pavel Emelyanov
parent ee9258e80f
commit 4bd119ddf6

View File

@@ -435,14 +435,10 @@ int dump_namespaces(struct pstree_item *item, unsigned int ns_flags)
return -1; return -1;
} }
ns = ns_ids; for (ns = ns_ids; ns; ns = ns->next) {
while (ns) {
/* Skip current namespaces, which are in the list too */ /* Skip current namespaces, which are in the list too */
if (ns->pid == getpid()) { if (ns->pid == getpid())
ns = ns->next;
continue; continue;
}
pid = fork(); pid = fork();
if (pid < 0) { if (pid < 0) {
@@ -465,7 +461,6 @@ int dump_namespaces(struct pstree_item *item, unsigned int ns_flags)
pr_err("Namespaces dumping finished with error %d\n", status); pr_err("Namespaces dumping finished with error %d\n", status);
return -1; return -1;
} }
ns = ns->next;
} }
pr_info("Namespaces dump complete\n"); pr_info("Namespaces dump complete\n");