[CRIU] [PATCH] zdtm: Don't forget to create /dev/ptmx in new root

Cyrill Gorcunov gorcunov at openvz.org
Tue Oct 2 15:01:16 EDT 2012


Otherwise pty tests might fault.

Reported-by: Pavel Emelyanov <xemul at parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 test/zdtm/lib/ns.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
index 4349c3b..a90b0a0 100644
--- a/test/zdtm/lib/ns.c
+++ b/test/zdtm/lib/ns.c
@@ -62,6 +62,10 @@ static int prepare_mntns()
 			fprintf(stderr, "mkdir(/dev) failed: %m\n");
 			return -1;
 		}
+		if (mknod("/dev/ptmx", 0666 | S_IFCHR, makedev(5, 2)) && errno != EEXIST) {
+			fprintf(stderr, "mknod(/dev/ptmx) failed: %m\n");
+			return -1;
+		}
 		if (mkdir("/dev/pts", 0755) && errno != EEXIST) {
 			fprintf(stderr, "mkdir(/dev/pts) failed: %m\n");
 			return -1;
-- 
1.7.7.6



More information about the CRIU mailing list