2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

mountpoints: don't re-create /dev/null

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrew Vagin
2015-12-18 22:17:08 +03:00
committed by Pavel Emelyanov
parent 17c0461939
commit 66468976c4

View File

@@ -76,7 +76,6 @@ int main(int argc, char **argv)
int fd, tmpfs_fd, have_bfmtm = 0; int fd, tmpfs_fd, have_bfmtm = 0;
unsigned fs_cnt, fs_cnt_last = 0; unsigned fs_cnt, fs_cnt_last = 0;
struct ns_exec_args args; struct ns_exec_args args;
mode_t old_mask;
pid_t pid = -1; pid_t pid = -1;
test_init(argc, argv); test_init(argc, argv);
@@ -266,17 +265,6 @@ done:
"binfmt_misc", 0, "") == 0) "binfmt_misc", 0, "") == 0)
have_bfmtm = 1; have_bfmtm = 1;
unlink("/dev/null");
/*
* Clear umask first, create readable & writeable /dev/null,
* and change it back. This is done to ensure that file mode
* creation mask will not impede it to create file that grants
* read and write permission to all users.
*/
old_mask = umask(0);
mknod("/dev/null", 0777 | S_IFCHR, makedev(1, 3));
umask(old_mask);
fd = open(MPTS_ROOT"/kernel/meminfo", O_RDONLY); fd = open(MPTS_ROOT"/kernel/meminfo", O_RDONLY);
if (fd == -1) if (fd == -1)
return 1; return 1;