diff options
| author | Richard M. Stallman | 1993-08-15 03:52:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-15 03:52:43 +0000 |
| commit | 889255b45853ad1ead6a067056cb39bf5fbbc0a9 (patch) | |
| tree | 291c777131b49392bbdf747365e31c9bc9e5f37c /src | |
| parent | 2313b945f2383644aee802dac56e1b6dde84e7ea (diff) | |
| download | emacs-889255b45853ad1ead6a067056cb39bf5fbbc0a9.tar.gz emacs-889255b45853ad1ead6a067056cb39bf5fbbc0a9.zip | |
Include syswait.h.
(wait_reading_process_input): Exit without waiting
if wait_for_cell is already non-nil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 73 |
1 files changed, 5 insertions, 68 deletions
diff --git a/src/process.c b/src/process.c index 643c87d1227..45fec280cce 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -104,74 +104,7 @@ static Lisp_Object stream_process; | |||
| 104 | 104 | ||
| 105 | #include "syssignal.h" | 105 | #include "syssignal.h" |
| 106 | 106 | ||
| 107 | /* Define the structure that the wait system call stores. | 107 | #include "syswait.h" |
| 108 | On many systems, there is a structure defined for this. | ||
| 109 | But on vanilla-ish USG systems there is not. */ | ||
| 110 | |||
| 111 | #ifndef VMS | ||
| 112 | #ifndef WAITTYPE | ||
| 113 | #if (!defined (BSD) && !defined (UNIPLUS) && !defined (STRIDE) && !(defined (HPUX) && !defined (NOMULTIPLEJOBS)) && !defined (HAVE_WAIT_HEADER)) || defined (LINUX) | ||
| 114 | #define WAITTYPE int | ||
| 115 | #define WIFSTOPPED(w) ((w&0377) == 0177) | ||
| 116 | #define WIFSIGNALED(w) ((w&0377) != 0177 && (w&~0377) == 0) | ||
| 117 | #define WIFEXITED(w) ((w&0377) == 0) | ||
| 118 | #define WRETCODE(w) (w >> 8) | ||
| 119 | #define WSTOPSIG(w) (w >> 8) | ||
| 120 | #define WTERMSIG(w) (w & 0377) | ||
| 121 | #ifndef WCOREDUMP | ||
| 122 | #define WCOREDUMP(w) ((w&0200) != 0) | ||
| 123 | #endif | ||
| 124 | #else | ||
| 125 | #ifdef BSD4_1 | ||
| 126 | #include <wait.h> | ||
| 127 | #else | ||
| 128 | #include <sys/wait.h> | ||
| 129 | #endif /* not BSD 4.1 */ | ||
| 130 | |||
| 131 | #define WAITTYPE union wait | ||
| 132 | #define WRETCODE(w) w.w_retcode | ||
| 133 | #define WCOREDUMP(w) w.w_coredump | ||
| 134 | |||
| 135 | #ifdef HPUX | ||
| 136 | /* HPUX version 7 has broken definitions of these. */ | ||
| 137 | #undef WTERMSIG | ||
| 138 | #undef WSTOPSIG | ||
| 139 | #undef WIFSTOPPED | ||
| 140 | #undef WIFSIGNALED | ||
| 141 | #undef WIFEXITED | ||
| 142 | #endif | ||
| 143 | |||
| 144 | #ifndef WTERMSIG | ||
| 145 | #define WTERMSIG(w) w.w_termsig | ||
| 146 | #endif | ||
| 147 | #ifndef WSTOPSIG | ||
| 148 | #define WSTOPSIG(w) w.w_stopsig | ||
| 149 | #endif | ||
| 150 | #ifndef WIFSTOPPED | ||
| 151 | #define WIFSTOPPED(w) (WTERMSIG (w) == 0177) | ||
| 152 | #endif | ||
| 153 | #ifndef WIFSIGNALED | ||
| 154 | #define WIFSIGNALED(w) (WTERMSIG (w) != 0177 && (WSTOPSIG (w)) == 0) | ||
| 155 | #endif | ||
| 156 | #ifndef WIFEXITED | ||
| 157 | #define WIFEXITED(w) (WTERMSIG (w) == 0) | ||
| 158 | #endif | ||
| 159 | #endif /* BSD or UNIPLUS or STRIDE */ | ||
| 160 | #endif /* no WAITTYPE */ | ||
| 161 | #else /* VMS */ | ||
| 162 | #define WAITTYPE int | ||
| 163 | #define WIFSTOPPED(w) 0 | ||
| 164 | #define WIFSIGNALED(w) 0 | ||
| 165 | #define WIFEXITED(w) ((w) != -1) | ||
| 166 | #define WRETCODE(w) (w) | ||
| 167 | #define WSTOPSIG(w) (w) | ||
| 168 | #define WCOREDUMP(w) 0 | ||
| 169 | #define WTERMSIG(w) (w) | ||
| 170 | #include <ssdef.h> | ||
| 171 | #include <iodef.h> | ||
| 172 | #include <clidef.h> | ||
| 173 | #include "vmsproc.h" | ||
| 174 | #endif /* VMS */ | ||
| 175 | 108 | ||
| 176 | extern errno; | 109 | extern errno; |
| 177 | extern sys_nerr; | 110 | extern sys_nerr; |
| @@ -1751,6 +1684,10 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 1751 | if (XINT (read_kbd) >= 0) | 1684 | if (XINT (read_kbd) >= 0) |
| 1752 | QUIT; | 1685 | QUIT; |
| 1753 | 1686 | ||
| 1687 | /* Exit now if the cell we're waiting for became non-nil. */ | ||
| 1688 | if (wait_for_cell && ! NILP (*wait_for_cell)) | ||
| 1689 | break; | ||
| 1690 | |||
| 1754 | /* Compute time from now till when time limit is up */ | 1691 | /* Compute time from now till when time limit is up */ |
| 1755 | /* Exit if already run out */ | 1692 | /* Exit if already run out */ |
| 1756 | if (time_limit == -1) | 1693 | if (time_limit == -1) |