]> code.delx.au - gnu-emacs/blobdiff - src/sysdep.c
(child_setup_tty): Use IUCLC, OLCUC, NLDLY only if defined.
[gnu-emacs] / src / sysdep.c
index be07dbe9db6205615d7c375d959e957ef99bf488..119177b78a1fff8519099afbc3bb723cfea07d0a 100644 (file)
@@ -464,14 +464,18 @@ child_setup_tty (out)
 #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
   s.main.c_oflag |= OPOST;     /* Enable output postprocessing */
   s.main.c_oflag &= ~ONLCR;    /* Disable map of NL to CR-NL on output */
+#ifdef NLDLY
   s.main.c_oflag &= ~(NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY);
                                /* No output delays */
+#endif
   s.main.c_lflag &= ~ECHO;     /* Disable echo */
   s.main.c_lflag |= ISIG;      /* Enable signals */
-  s.main.c_iflag &= ~IUCLC;    /* Disable map of upper case to lower on
-                                  input */
-  s.main.c_oflag &= ~OLCUC;    /* Disable map of lower case to upper on
-                                  output */
+#ifdef IUCLC
+  s.main.c_iflag &= ~IUCLC;    /* Disable downcasing on input.  */
+#endif
+@ifdef OLCUC
+  s.main.c_oflag &= ~OLCUC;    /* Disable upcasing on output.  */
+#endif
   s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */
 #if 0
   /* Said to be unnecessary:  */
@@ -834,7 +838,7 @@ unrequest_sigio ()
 \f
 /* Saving and restoring the process group of Emacs's terminal.  */
 
-#ifdef BSD
+#ifdef BSD_PGRPS
 
 /* The process group of which Emacs was a member when it initially
    started.
@@ -878,7 +882,7 @@ widen_foreground_group ()
   setpgrp (0, inherited_pgroup);
 }
 
-#endif
+#endif /* BSD_PGRPS */
 \f
 /* Getting and setting emacs_tty structures.  */
 
@@ -1111,7 +1115,7 @@ init_sys_modes ()
 #endif
 #endif /* not VMS */
 
-#ifdef BSD
+#ifdef BSD_PGRPS
   if (! read_socket_hook && EQ (Vwindow_system, Qnil))
     narrow_foreground_group ();
 #endif
@@ -1131,7 +1135,7 @@ init_sys_modes ()
       tty.main.c_lflag &= ~ECHO;       /* Disable echo */
       tty.main.c_lflag &= ~ICANON;     /* Disable erase/kill processing */
 #ifdef IEXTEN
-      tty.main.c_iflag &= ~IEXTEN;     /* Disable other editing characters.  */
+      tty.main.c_lflag &= ~IEXTEN;     /* Disable other editing characters.  */
 #endif
       tty.main.c_lflag |= ISIG;        /* Enable signals */
       if (flow_control)
@@ -1483,7 +1487,7 @@ reset_sys_modes ()
   hft_reset ();
 #endif
 
-#ifdef BSD
+#ifdef BSD_PGRPS
   widen_foreground_group ();
 #endif
 }
@@ -1796,7 +1800,7 @@ unrequest_sigio ()
  *
  */
 
-#ifndef CANNOT_UNEXEC
+#if !defined (CANNOT_UNEXEC) && !defined (HAVE_TEXT_START)
 char *
 start_of_text ()
 {
@@ -1812,7 +1816,7 @@ start_of_text ()
 #endif /* GOULD */
 #endif /* TEXT_START */
 }
-#endif /* not CANNOT_UNEXEC */
+#endif /* not CANNOT_UNEXEC and not HAVE_TEXT_START */
 
 /*
  *     Return the address of the start of the data segment prior to
@@ -2754,7 +2758,7 @@ sys_write (fildes, buf, nbyte)
          if (errno == EINTR)
            continue;
          else
-           return (-1);
+           return (bytes_written ? bytes_written : -1);
        }
 
       buf += rtnval;