Add the reset atexit handler right after setting the terminal to raw mode, so we...
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Thu, 21 Sep 2006 19:42:31 +0000 (19:42 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Thu, 21 Sep 2006 19:42:31 +0000 (19:42 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2325 94cd875c-1c1d-0410-91d2-eb244daf1a30

src/vlogin.c

index 56a1df0..70a8aed 100644 (file)
@@ -209,6 +209,9 @@ void do_vlogin(int argc, char *argv[], int ind)
   /* set terminal to raw mode */
   terminal_raw();
 
+  /* reset terminal to its original mode */
+  atexit(terminal_reset);
+
   /* fork new pseudo terminal */
   if (openpty(&t.fd, &slave, NULL, NULL, NULL) == -1) {
     perror(ENSC_WRAPPERS_PREFIX "openpty()");
@@ -254,9 +257,6 @@ void do_vlogin(int argc, char *argv[], int ind)
 
   strncpy(argv[0], "login", n);
 
-  /* reset terminal to its original mode */
-  atexit(terminal_reset);
-
   /* we want a redraw */
   terminal_redraw();