(child_setup_tty): Use CDISABLE for setting VERASE, VKILL.
[bpt/emacs.git] / src / sysdep.c
index ff5de4f..7c8a072 100644 (file)
@@ -524,8 +524,8 @@ child_setup_tty (out)
 
   s.main.c_lflag |= ICANON;    /* Enable erase/kill and eof processing */
   s.main.c_cc[VEOF] = 04;      /* insure that EOF is Control-D */
-  s.main.c_cc[VERASE] = 0377;  /* disable erase processing */
-  s.main.c_cc[VKILL] = 0377;   /* disable kill processing */
+  s.main.c_cc[VERASE] = CDISABLE;      /* disable erase processing */
+  s.main.c_cc[VKILL] = CDISABLE;       /* disable kill processing */
 
 #ifdef HPUX
   s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */
@@ -1290,9 +1290,14 @@ init_sys_modes ()
       tty.main.c_cc[VSTOP] = CDISABLE;
 #endif /* VSTOP */
 #endif /* mips or HAVE_TCATTR */
+#ifdef SET_LINE_DISCIPLINE
+      /* Need to explicitely request TERMIODISC line discipline or
+         Ultrix's termios does not work correctly.  */
+      tty.main.c_line = SET_LINE_DISCIPLINE;
+#endif
 #ifdef AIX
 #ifndef IBMR2AIX
-      /* AIX enhanced edit loses NULs, so disable it */
+      /* AIX enhanced edit loses NULs, so disable it */
       tty.main.c_line = 0;
       tty.main.c_iflag &= ~ASCEDIT;
 #else
@@ -1386,7 +1391,7 @@ init_sys_modes ()
       if (!flow_control) tcflow (input_fd, TCOON);
 #endif
 
-#ifdef AIX
+#ifdef AIXHFT
       hft_init ();
 #ifdef IBMR2AIX
       {
@@ -1398,7 +1403,7 @@ init_sys_modes ()
          write (1, "\033[20l", 5);
       }
 #endif
-#endif
+#endif /* AIXHFT */
 
 #ifdef VMS
 /*  Appears to do nothing when in PASTHRU mode.
@@ -1597,7 +1602,7 @@ reset_sys_modes ()
   clear_end_of_line (FRAME_WIDTH (selected_frame));
   /* clear_end_of_line may move the cursor */
   cursor_to (FRAME_HEIGHT (selected_frame) - 1, 0);
-#ifdef IBMR2AIX
+#if defined (IBMR2AIX) && defined (AIXHFT)
   {
     /* HFT devices normally use ^J as a LF/CR.  We forced it to 
        do the LF only.  Now, we need to reset it. */
@@ -1643,7 +1648,14 @@ reset_sys_modes ()
   dos_ttcooked ();
 #endif
 
-#ifdef AIX
+#ifdef SET_LINE_DISCIPLINE
+  /* Ultrix's termios *ignores* any line discipline except TERMIODISC.
+     A different old line discipline is therefore not restored, yet.
+     Restore the old line discipline by hand.  */
+  ioctl (0, TIOCSETD, &old_tty.main.c_line);
+#endif
+
+#ifdef AIXHFT
   hft_reset ();
 #endif
 
@@ -4851,7 +4863,7 @@ srandom (seed)
 }
 #endif /* VMS */
 \f
-#ifdef AIX
+#ifdef AIXHFT
 
 /* Called from init_sys_modes.  */
 hft_init ()
@@ -4943,7 +4955,7 @@ hft_reset ()
   hftctl (0, HFSKBD, &buf);
 }
 
-#endif /* AIX */
+#endif /* AIXHFT */
 
 #ifdef USE_DL_STUBS