diff --git a/test/zdtm/live/static/tty02.c b/test/zdtm/live/static/tty02.c index 3d73f892a..866bd3b93 100644 --- a/test/zdtm/live/static/tty02.c +++ b/test/zdtm/live/static/tty02.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -13,11 +12,6 @@ const char *test_doc = "Check a non-controling terminal"; const char *test_author = "Andrey Vagin "; -static void sighup_handler(int signo) -{ - test_msg("SIGHUP is here\n"); -} - int main(int argc, char ** argv) { int fdm, fds; @@ -26,8 +20,6 @@ int main(int argc, char ** argv) test_init(argc, argv); - signal(SIGHUP, sighup_handler); - setsid(); fdm = open("/dev/ptmx", O_RDWR); @@ -41,17 +33,12 @@ int main(int argc, char ** argv) slavename = ptsname(fdm); /* set up a controlling terminal */ - fds = open(slavename, O_RDWR); + fds = open(slavename, O_RDWR | O_NOCTTY); if (fds == -1) { err("Can't open a slave pseudoterminal %s", slavename); return 1; } - if (ioctl(fds, TIOCNOTTY)) { - err("Unable to detach a terminal"); - return 1; - } - test_daemon(); test_waitsig();