[CRIU] [PATCH 9/9] tty: test -- Add /dev/tty testing into pty00
Cyrill Gorcunov
gorcunov at openvz.org
Fri Mar 6 02:39:25 PST 2015
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
test/zdtm/live/static/pty00.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/zdtm/live/static/pty00.c b/test/zdtm/live/static/pty00.c
index b8553223abd8..02c06fdf9660 100644
--- a/test/zdtm/live/static/pty00.c
+++ b/test/zdtm/live/static/pty00.c
@@ -21,7 +21,7 @@ static void signal_handler_sighup(int signum)
int main(int argc, char ** argv)
{
- int fdm, fds, ret;
+ int fdm, fds, ret, tty;
char *slavename;
char buf[10];
const char teststr[] = "hello\n";
@@ -56,6 +56,12 @@ int main(int argc, char ** argv)
return 1;
}
+ tty = open("/dev/tty", O_RDWR);
+ if (tty < 0) {
+ err("open(%s) failed", "/dev/tty");
+ return 1;
+ }
+
/* Try to reproduce a deadlock */
if (dup2(fdm, 101) != 101) {
err("dup( , 101) failed");
--
1.9.3
More information about the CRIU
mailing list