[CRIU] [PATCH 1/2] mountpoints: don't re-create /dev/null

Andrey Vagin avagin at openvz.org
Fri Dec 18 11:17:08 PST 2015


From: Andrew Vagin <avagin at virtuozzo.com>

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/zdtm/live/static/mountpoints.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/test/zdtm/live/static/mountpoints.c b/test/zdtm/live/static/mountpoints.c
index ac7386c..f76770b 100644
--- a/test/zdtm/live/static/mountpoints.c
+++ b/test/zdtm/live/static/mountpoints.c
@@ -72,7 +72,6 @@ int main(int argc, char **argv)
 {
 	int fd, tmpfs_fd, have_bfmtm = 0;
 	struct ns_exec_args args;
-	mode_t old_mask;
 	pid_t pid = -1;
 
 	test_init(argc, argv);
@@ -214,17 +213,6 @@ int main(int argc, char **argv)
 					"binfmt_misc", 0, "") == 0)
 		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);
 	if (fd == -1)
 		return 1;
-- 
2.4.3



More information about the CRIU mailing list