]> code.delx.au - gnu-emacs/blobdiff - src/process.c
* buffer.c (Fset_buffer_major_mode): Doc fix.
[gnu-emacs] / src / process.c
index c941a19653929fd306af6d69af6351cfefe71134..77e99ead01f1d7361c1f7693a0f407bae1075a2f 100644 (file)
@@ -125,6 +125,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "xgselect.h"
 #endif
 
+#ifdef WINDOWSNT
+extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
+                      EMACS_TIME *, void *);
+#endif
+
 #ifndef WNOHANG
 # undef waitpid
 # define waitpid(pid, status, options) wait (status)
@@ -646,23 +651,6 @@ allocate_pty (void)
        PTY_OPEN;
 #else /* no PTY_OPEN */
        {
-         { /* Some systems name their pseudoterminals so that there are gaps in
-              the usual sequence - for example, on HP9000/S700 systems, there
-              are no pseudoterminals with names ending in 'f'.  So we wait for
-              three failures in a row before deciding that we've reached the
-              end of the ptys.  */
-           int failed_count = 0;
-           struct stat stb;
-
-           if (stat (pty_name, &stb) < 0)
-             {
-               failed_count++;
-               if (failed_count >= 3)
-                 return -1;
-             }
-           else
-             failed_count = 0;
-         }
 #  ifdef O_NONBLOCK
          fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0);
 #  else
@@ -1771,12 +1759,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
 #endif
        }
 #else /* not HAVE_SETSID */
-#ifdef USG
-      /* It's very important to call setpgrp here and no time
+      /* It's very important to call setpgid here and no time
         afterwards.  Otherwise, we lose our controlling tty which
         is set when we open the pty. */
-      setpgrp ();
-#endif /* USG */
+      setpgid (0, 0);
 #endif /* not HAVE_SETSID */
 #if defined (LDISC1)
       if (pty_flag && xforkin >= 0)
@@ -1814,11 +1800,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
          /* In order to get a controlling terminal on some versions
             of BSD, it is necessary to put the process in pgrp 0
             before it opens the terminal.  */
-#ifdef HAVE_SETPGID
          setpgid (0, 0);
-#else
-         setpgrp (0, 0);
-#endif
 #endif
        }
 #endif /* TIOCNOTTY */
@@ -4302,7 +4284,7 @@ wait_reading_process_output_1 (void)
      -1 meaning caller will actually read the input, so don't throw to
        the quit handler, or
 
-   DO_DISPLAY != 0 means redisplay should be done to show subprocess
+   DO_DISPLAY means redisplay should be done to show subprocess
      output that arrives.
 
    If WAIT_FOR_CELL is a cons cell, wait until its car is non-nil
@@ -4322,7 +4304,7 @@ wait_reading_process_output_1 (void)
 
 int
 wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
-                            int do_display,
+                            bool do_display,
                             Lisp_Object wait_for_cell,
                             struct Lisp_Process *wait_proc, int just_wait_proc)
 {
@@ -4419,7 +4401,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 
          do
            {
-             int old_timers_run = timers_run;
+             unsigned old_timers_run = timers_run;
              struct buffer *old_buffer = current_buffer;
              Lisp_Object old_window = selected_window;
 
@@ -4753,7 +4735,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 
       if (read_kbd != 0)
        {
-         int old_timers_run = timers_run;
+         unsigned old_timers_run = timers_run;
          struct buffer *old_buffer = current_buffer;
          Lisp_Object old_window = selected_window;
          int leave = 0;
@@ -6821,14 +6803,14 @@ extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
    see full version for other parameters. We know that wait_proc will
      always be NULL, since `subprocesses' isn't defined.
 
-   DO_DISPLAY != 0 means redisplay should be done to show subprocess
+   DO_DISPLAY means redisplay should be done to show subprocess
    output that arrives.
 
    Return true if we received input from any process.  */
 
 int
 wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
-                            int do_display,
+                            bool do_display,
                             Lisp_Object wait_for_cell,
                             struct Lisp_Process *wait_proc, int just_wait_proc)
 {
@@ -6904,7 +6886,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 
          do
            {
-             int old_timers_run = timers_run;
+             unsigned old_timers_run = timers_run;
              timer_delay = timer_check ();
              if (timers_run != old_timers_run && do_display)
                /* We must retry, since a timer may have requeued itself