1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-14 09:39:42 +00:00

Remove more "#ifdef subprocesses".

process.c <inhibit_sentinels>: Move to the common part.
 (Fwaiting_for_user_input_p): Move to the common part; return nil
 if async subprocesses aren't supported.
 sysdep.c (wait_for_termination) [!MSDOS]: Don't compile on
 MS-DOS.  Remove "#ifdef subprocesses".
 (sys_subshell, sys_select): Remove "#ifdef subprocesses".
 (gettimeofday): Remove "#ifdef subprocesses".
 (wait_without_blocking): Remove function.
 (flush_pending_output, child_setup_tty): Don't compile on MS-DOS.
 Remove "#ifdef subprocesses".
 (child_setup_tty): Use WINDOWSNT instead of DOS_NT, since not
 compiled on MS-DOS.
 callproc.c (Fcall_process) [!MSDOS]: Don't call
 wait_for_termination on MS-DOS.
 emacs.c (shut_down_emacs): Remove "#ifndef subprocesses" from
 initialization of inhibit_sentinels.
 keyboard.c (record_asynch_buffer_change): Remove "#ifdef
 subprocesses" conditional.
 callproc.c (Fcall_process) [!subprocesses]: Don't call
 wait_for_termination, since `buffer' cannot be an integer when
 async subprocesses are not supported
 xdisp.c (decode_mode_spec): Use `MSDOS' instead of `subprocesses'
 for ifdefing away the call to Fprocess_status.
This commit is contained in:
Eli Zaretskii 2010-07-13 13:57:00 +03:00
parent 2047750525
commit 77defa9a25
7 changed files with 53 additions and 56 deletions

View File

@ -1,5 +1,30 @@
2010-07-13 Eli Zaretskii <eliz@gnu.org> 2010-07-13 Eli Zaretskii <eliz@gnu.org>
Remove subprocesses #ifdefs.
* process.c <inhibit_sentinels>: Move to the common part.
(Fwaiting_for_user_input_p): Move to the common part; return nil
if async subprocesses aren't supported.
* sysdep.c (wait_for_termination) [!MSDOS]: Don't compile on
MS-DOS. Remove "#ifdef subprocesses".
(sys_subshell, sys_select): Remove "#ifdef subprocesses".
(gettimeofday): Remove "#ifdef subprocesses".
(wait_without_blocking): Remove function.
(flush_pending_output, child_setup_tty): Don't compile on MS-DOS.
Remove "#ifdef subprocesses".
(child_setup_tty): Use WINDOWSNT instead of DOS_NT, since not
compiled on MS-DOS.
* callproc.c (Fcall_process) [!MSDOS]: Don't call
wait_for_termination on MS-DOS.
* emacs.c (shut_down_emacs): Remove "#ifndef subprocesses" from
initialization of inhibit_sentinels.
* keyboard.c (record_asynch_buffer_change): Remove "#ifdef
subprocesses" conditional.
* callproc.c (Fcall_process) [!subprocesses]: Don't call
wait_for_termination, since `buffer' cannot be an integer when
async subprocesses are not supported
* xdisp.c (decode_mode_spec): Use `MSDOS' instead of `subprocesses'
for ifdefing away the call to Fprocess_status.
* process.c (add_keyboard_wait_descriptor) [!subprocesses]: Ifdef * process.c (add_keyboard_wait_descriptor) [!subprocesses]: Ifdef
away the entire body of the function. away the entire body of the function.

View File

@ -612,12 +612,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
{ {
if (fd[0] >= 0) if (fd[0] >= 0)
emacs_close (fd[0]); emacs_close (fd[0]);
#ifndef subprocesses
/* If Emacs has been built with asynchronous subprocess support,
we don't need to do this, I think because it will then have
the facilities for handling SIGCHLD. */
wait_without_blocking ();
#endif /* subprocesses */
return Qnil; return Qnil;
} }
@ -811,8 +805,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
make_number (total_read)); make_number (total_read));
} }
#ifndef MSDOS
/* Wait for it to terminate, unless it already has. */ /* Wait for it to terminate, unless it already has. */
wait_for_termination (pid); wait_for_termination (pid);
#endif
immediate_quit = 0; immediate_quit = 0;

View File

@ -2130,9 +2130,7 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
stuff_buffered_input (stuff); stuff_buffered_input (stuff);
#ifdef subprocesses
inhibit_sentinels = 1; inhibit_sentinels = 1;
#endif
kill_buffer_processes (Qnil); kill_buffer_processes (Qnil);
Fdo_auto_save (Qt, Qnil); Fdo_auto_save (Qt, Qnil);

View File

@ -6901,18 +6901,15 @@ record_asynch_buffer_change (void)
event.frame_or_window = Qnil; event.frame_or_window = Qnil;
event.arg = Qnil; event.arg = Qnil;
#ifdef subprocesses
/* We don't need a buffer-switch event unless Emacs is waiting for input. /* We don't need a buffer-switch event unless Emacs is waiting for input.
The purpose of the event is to make read_key_sequence look up the The purpose of the event is to make read_key_sequence look up the
keymaps again. If we aren't in read_key_sequence, we don't need one, keymaps again. If we aren't in read_key_sequence, we don't need one,
and the event could cause trouble by messing up (input-pending-p). */ and the event could cause trouble by messing up (input-pending-p).
Note: Fwaiting_for_user_input_p always returns nil when async
subprocesses aren't supported. */
tem = Fwaiting_for_user_input_p (); tem = Fwaiting_for_user_input_p ();
if (NILP (tem)) if (NILP (tem))
return; return;
#else
/* We never need these events if we have no asynchronous subprocesses. */
return;
#endif
/* Make sure no interrupt happens while storing the event. */ /* Make sure no interrupt happens while storing the event. */
#ifdef SIGIO #ifdef SIGIO

View File

@ -304,6 +304,10 @@ static int kbd_is_on_hold;
/* Nonzero means delete a process right away if it exits. */ /* Nonzero means delete a process right away if it exits. */
static int delete_exited_processes; static int delete_exited_processes;
/* Nonzero means don't run process sentinels. This is used
when exiting. */
int inhibit_sentinels;
#ifdef subprocesses #ifdef subprocesses
/* Mask of bits indicating the descriptors that we wait for input on. */ /* Mask of bits indicating the descriptors that we wait for input on. */
@ -381,10 +385,6 @@ struct sockaddr_and_len {
/* Maximum number of bytes to send to a pty without an eof. */ /* Maximum number of bytes to send to a pty without an eof. */
static int pty_max_bytes; static int pty_max_bytes;
/* Nonzero means don't run process sentinels. This is used
when exiting. */
int inhibit_sentinels;
#ifdef HAVE_PTYS #ifdef HAVE_PTYS
#ifdef HAVE_PTY_H #ifdef HAVE_PTY_H
#include <pty.h> #include <pty.h>
@ -5433,15 +5433,6 @@ read_process_output (Lisp_Object proc, register int channel)
unbind_to (count, Qnil); unbind_to (count, Qnil);
return nbytes; return nbytes;
} }
DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p,
0, 0, 0,
doc: /* Returns non-nil if Emacs is waiting for input from the user.
This is intended for use by asynchronous process output filters and sentinels. */)
(void)
{
return (waiting_for_user_input_p ? Qt : Qnil);
}
/* Sending data to subprocess */ /* Sending data to subprocess */
@ -7279,6 +7270,19 @@ kill_buffer_processes (Lisp_Object buffer)
#endif /* subprocesses */ #endif /* subprocesses */
} }
DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p,
0, 0, 0,
doc: /* Returns non-nil if Emacs is waiting for input from the user.
This is intended for use by asynchronous process output filters and sentinels. */)
(void)
{
#ifdef subprocesses
return (waiting_for_user_input_p ? Qt : Qnil);
#else
return Qnil;
#endif
}
/* Stop reading input from keyboard sources. */ /* Stop reading input from keyboard sources. */
void void

View File

@ -355,16 +355,6 @@ set_exclusive_use (int fd)
/* Ok to do nothing if this feature does not exist */ /* Ok to do nothing if this feature does not exist */
} }
#ifndef subprocesses
void
wait_without_blocking (void)
{
croak ("wait_without_blocking");
synch_process_alive = 0;
}
#endif /* not subprocesses */
int wait_debugging; /* Set nonzero to make following function work under dbx int wait_debugging; /* Set nonzero to make following function work under dbx
(at least for bsd). */ (at least for bsd). */
@ -373,6 +363,7 @@ SIGTYPE
wait_for_termination_signal (void) wait_for_termination_signal (void)
{} {}
#ifndef MSDOS
/* Wait for subprocess with process id `pid' to terminate and /* Wait for subprocess with process id `pid' to terminate and
make sure it will get eliminated (not remain forever as a zombie) */ make sure it will get eliminated (not remain forever as a zombie) */
@ -381,7 +372,6 @@ wait_for_termination (int pid)
{ {
while (1) while (1)
{ {
#ifdef subprocesses
#if defined (BSD_SYSTEM) || defined (HPUX) #if defined (BSD_SYSTEM) || defined (HPUX)
/* Note that kill returns -1 even if the process is just a zombie now. /* Note that kill returns -1 even if the process is just a zombie now.
But inevitably a SIGCHLD interrupt should be generated But inevitably a SIGCHLD interrupt should be generated
@ -417,14 +407,9 @@ wait_for_termination (int pid)
sigsuspend (&empty_mask); sigsuspend (&empty_mask);
#endif /* not WINDOWSNT */ #endif /* not WINDOWSNT */
#endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */
#else /* not subprocesses */
break;
#endif /* not subprocesses */
} }
} }
#ifdef subprocesses
/* /*
* flush any pending output * flush any pending output
* (may flush input as well; it does not matter the way we use it) * (may flush input as well; it does not matter the way we use it)
@ -459,7 +444,7 @@ flush_pending_output (int channel)
void void
child_setup_tty (int out) child_setup_tty (int out)
{ {
#ifndef DOS_NT #ifndef WINDOWSNT
struct emacs_tty s; struct emacs_tty s;
EMACS_GET_TTY (out, &s); EMACS_GET_TTY (out, &s);
@ -543,10 +528,10 @@ child_setup_tty (int out)
EMACS_SET_TTY (out, &s, 0); EMACS_SET_TTY (out, &s, 0);
#endif /* not DOS_NT */ #endif /* not WINDOWSNT */
} }
#endif /* MSDOS */
#endif /* subprocesses */
/* Record a signal code and the handler for it. */ /* Record a signal code and the handler for it. */
struct save_signal struct save_signal
@ -650,9 +635,7 @@ sys_subshell (void)
if (str) if (str)
chdir ((char *) str); chdir ((char *) str);
#ifdef subprocesses
close_process_descs (); /* Close Emacs's pipes/ptys */ close_process_descs (); /* Close Emacs's pipes/ptys */
#endif
#ifdef SET_EMACS_PRIORITY #ifdef SET_EMACS_PRIORITY
{ {
@ -1699,11 +1682,7 @@ sys_select (int nfds,
int timeoutval; int timeoutval;
int *local_timeout; int *local_timeout;
extern int proc_buffered_char[]; extern int proc_buffered_char[];
#ifndef subprocesses
int process_tick = 0, update_tick = 0;
#else
extern int process_tick, update_tick; extern int process_tick, update_tick;
#endif
unsigned char buf; unsigned char buf;
#if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS) #if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS)
@ -2433,7 +2412,6 @@ dup2 (int oldd, int newd)
* Only needed when subprocesses are defined. * Only needed when subprocesses are defined.
*/ */
#ifdef subprocesses
#ifndef HAVE_GETTIMEOFDAY #ifndef HAVE_GETTIMEOFDAY
#ifdef HAVE_TIMEVAL #ifdef HAVE_TIMEVAL
@ -2451,8 +2429,7 @@ gettimeofday (struct timeval *tp, struct timezone *tzp)
} }
#endif #endif
#endif #endif /* !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */
#endif /* subprocess && !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */
/* /*
* This function will go away as soon as all the stubs fixed. (fnf) * This function will go away as soon as all the stubs fixed. (fnf)

View File

@ -19597,7 +19597,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
obj = Fget_buffer_process (Fcurrent_buffer ()); obj = Fget_buffer_process (Fcurrent_buffer ());
if (NILP (obj)) if (NILP (obj))
return "no process"; return "no process";
#ifdef subprocesses #ifndef MSDOS
obj = Fsymbol_name (Fprocess_status (obj)); obj = Fsymbol_name (Fprocess_status (obj));
#endif #endif
break; break;