Commit 66468976 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

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

Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 17c04619
...@@ -76,7 +76,6 @@ int main(int argc, char **argv) ...@@ -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: ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment