diff src/process.c @ 91367:c70e45a7acfd

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
author Miles Bader <miles@gnu.org>
date Wed, 30 Jan 2008 07:57:28 +0000
parents 606f2d163a64 8f7e97005eef
children f14242124fd7
line wrap: on
line diff
--- a/src/process.c	Wed Jan 30 06:40:42 2008 +0000
+++ b/src/process.c	Wed Jan 30 07:57:28 2008 +0000
@@ -78,7 +78,7 @@
 #include <client.h>
 #endif
 
-/* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
+/* On some systems, inet_addr returns a 'struct in_addr'. */
 #ifdef HAVE_BROKEN_INET_ADDR
 #define IN_ADDR struct in_addr
 #define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
@@ -87,12 +87,12 @@
 #define NUMERIC_ADDR_ERROR (numeric_addr == -1)
 #endif
 
-#if defined(BSD_SYSTEM) || defined(STRIDE)
+#if defined(BSD_SYSTEM)
 #include <sys/ioctl.h>
 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
 #include <fcntl.h>
 #endif /* HAVE_PTYS and no O_NDELAY */
-#endif /* BSD_SYSTEM || STRIDE */
+#endif /* BSD_SYSTEM */
 
 #ifdef BROKEN_O_NONBLOCK
 #undef O_NONBLOCK
@@ -596,7 +596,6 @@
 #else
             sprintf (pty_name, "/dev/tty%c%x", c, i);
 #endif /* no PTY_TTY_NAME_SPRINTF */
-#ifndef UNIPLUS
 	    if (access (pty_name, 6) != 0)
 	      {
 		emacs_close (fd);
@@ -606,7 +605,6 @@
 		return -1;
 # endif /* IRIS */
 	      }
-#endif /* not UNIPLUS */
 	    setup_pty (fd);
 	    return fd;
 	  }
@@ -1360,8 +1358,11 @@
 	w_proc = i;
       if (!NILP (p->buffer))
 	{
-	  if (NILP (XBUFFER (p->buffer)->name) && w_buffer < 8)
-	    w_buffer = 8;  /* (Killed) */
+	  if (NILP (XBUFFER (p->buffer)->name))
+	    {
+	      if (w_buffer < 8)
+		w_buffer = 8;  /* (Killed) */
+	    }
 	  else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer)))
 	    w_buffer = i;
 	}
@@ -1888,12 +1889,12 @@
 #endif
       if (forkin < 0)
 	report_file_error ("Opening pty", Qnil);
-#if defined (RTU) || defined (UNIPLUS) || defined (DONT_REOPEN_PTY)
+#if defined (DONT_REOPEN_PTY)
       /* In the case that vfork is defined as fork, the parent process
 	 (Emacs) may send some data before the child process completes
 	 tty options setup.  So we setup tty before forking.  */
       child_setup_tty (forkout);
-#endif /* RTU or UNIPLUS or DONT_REOPEN_PTY */
+#endif /* DONT_REOPEN_PTY */
 #else
       forkin = forkout = -1;
 #endif /* not USG, or USG_SUBTTY_WORKS */
@@ -1934,15 +1935,6 @@
   set_exclusive_use (outchannel);
 #endif
 
-/* Stride people say it's a mystery why this is needed
-   as well as the O_NDELAY, but that it fails without this.  */
-#if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS))
-  {
-    int one = 1;
-    ioctl (inchannel, FIONBIO, &one);
-  }
-#endif
-
 #ifdef O_NONBLOCK
   fcntl (inchannel, F_SETFL, O_NONBLOCK);
   fcntl (outchannel, F_SETFL, O_NONBLOCK);
@@ -1992,7 +1984,7 @@
 #ifdef BSD4_1
   sighold (SIGCHLD);
 #else /* not BSD4_1 */
-#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX)
+#if defined (BSD_SYSTEM) || defined (HPUX)
   sigsetmask (sigmask (SIGCHLD));
 #else /* ordinary USG */
 #if 0
@@ -2106,7 +2098,7 @@
 	  }
 #endif /* TIOCNOTTY */
 
-#if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY)
+#if !defined (DONT_REOPEN_PTY)
 /*** There is a suggestion that this ought to be a
      conditional on TIOCSPGRP,
      or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)).
@@ -2140,7 +2132,7 @@
 	    ioctl (xforkout, TIOCSPGRP, &pgrp);
 #endif
 	  }
-#endif /* not UNIPLUS and not RTU and not DONT_REOPEN_PTY */
+#endif /* not DONT_REOPEN_PTY */
 
 #ifdef SETUP_SLAVE_PTY
 	if (pty_flag)
@@ -2167,7 +2159,7 @@
 #ifdef BSD4_1
 	sigrelse (SIGCHLD);
 #else /* not BSD4_1 */
-#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX)
+#if defined (BSD_SYSTEM) || defined (HPUX)
 	sigsetmask (SIGEMPTYMASK);
 #else /* ordinary USG */
 #if 0
@@ -2178,10 +2170,10 @@
 #endif /* SIGCHLD */
 #endif /* !POSIX_SIGNALS */
 
-#if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY)
+#if !defined (DONT_REOPEN_PTY)
 	if (pty_flag)
 	  child_setup_tty (xforkout);
-#endif /* not RTU and not UNIPLUS and not DONT_REOPEN_PTY */
+#endif /* not DONT_REOPEN_PTY */
 #ifdef WINDOWSNT
 	pid = child_setup (xforkin, xforkout, xforkout,
 			   new_argv, 1, current_dir);
@@ -2259,7 +2251,7 @@
 #ifdef BSD4_1
   sigrelse (SIGCHLD);
 #else /* not BSD4_1 */
-#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX)
+#if defined (BSD_SYSTEM) || defined (HPUX)
   sigsetmask (SIGEMPTYMASK);
 #else /* ordinary USG */
 #if 0
@@ -4650,12 +4642,6 @@
 	  else if (xerrno == ENOMEM)
 	    no_avail = 1;
 #endif
-#ifdef ALLIANT
-	  /* This happens for no known reason on ALLIANT.
-	     I am guessing that this is the right response. -- RMS.  */
-	  else if (xerrno == EFAULT)
-	    no_avail = 1;
-#endif
 	  else if (xerrno == EBADF)
 	    {
 #ifdef AIX
@@ -4717,6 +4703,7 @@
 	{
 	  int old_timers_run = timers_run;
 	  struct buffer *old_buffer = current_buffer;
+	  Lisp_Object old_window = selected_window;
 	  int leave = 0;
 
 	  if (detect_input_pending_run_timers (do_display))
@@ -4730,7 +4717,8 @@
 	     an alike.  Make read_key_sequence aware of that.  */
 	  if (timers_run != old_timers_run
 	      && waiting_for_user_input_p == -1
-	      && old_buffer != current_buffer)
+	      && (old_buffer != current_buffer
+	      || !EQ (old_window, selected_window)))
 	    record_asynch_buffer_change ();
 
 	  if (leave)