mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 23:35:21 +00:00
mntns: fix indentions
Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
a2fd8cd0a5
commit
ea20f5d221
48
mount.c
48
mount.c
@@ -577,34 +577,34 @@ static int clean_mnt_ns(void)
|
|||||||
|
|
||||||
static int cr_pivot_root()
|
static int cr_pivot_root()
|
||||||
{
|
{
|
||||||
char put_root[PATH_MAX] = "crtools-put-root.XXXXXX";
|
char put_root[PATH_MAX] = "crtools-put-root.XXXXXX";
|
||||||
|
|
||||||
pr_info("Move the root to %s", opts.root);
|
pr_info("Move the root to %s", opts.root);
|
||||||
|
|
||||||
if (chdir(opts.root)) {
|
if (chdir(opts.root)) {
|
||||||
pr_perror("chdir(%s) failed", opts.root);
|
pr_perror("chdir(%s) failed", opts.root);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (mkdtemp(put_root) == NULL) {
|
if (mkdtemp(put_root) == NULL) {
|
||||||
pr_perror("Can't create a temparary directory");
|
pr_perror("Can't create a temparary directory");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (pivot_root(".", put_root)) {
|
if (pivot_root(".", put_root)) {
|
||||||
pr_perror("pivot_root(., %s) failed", put_root);
|
pr_perror("pivot_root(., %s) failed", put_root);
|
||||||
if (rmdir(put_root))
|
if (rmdir(put_root))
|
||||||
pr_perror("Can't remove the directory %s", put_root);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (umount2(put_root, MNT_DETACH)) {
|
|
||||||
pr_perror("Can't umount %s", put_root);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (rmdir(put_root)) {
|
|
||||||
pr_perror("Can't remove the directory %s", put_root);
|
pr_perror("Can't remove the directory %s", put_root);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (umount2(put_root, MNT_DETACH)) {
|
||||||
|
pr_perror("Can't umount %s", put_root);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (rmdir(put_root)) {
|
||||||
|
pr_perror("Can't remove the directory %s", put_root);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int populate_mnt_ns(int ns_pid)
|
static int populate_mnt_ns(int ns_pid)
|
||||||
|
Reference in New Issue
Block a user