diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index 42743f6531a..eb27ddef45f 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -259,7 +259,7 @@ static bool process_output_skip; | |||
| 259 | 259 | ||
| 260 | static void start_process_unwind (Lisp_Object); | 260 | static void start_process_unwind (Lisp_Object); |
| 261 | static void create_process (Lisp_Object, char **, Lisp_Object); | 261 | static void create_process (Lisp_Object, char **, Lisp_Object); |
| 262 | #ifdef USABLE_SIGIO | 262 | #if defined (USABLE_SIGIO) || defined (USABLE_SIGPOLL) |
| 263 | static bool keyboard_bit_set (fd_set *); | 263 | static bool keyboard_bit_set (fd_set *); |
| 264 | #endif | 264 | #endif |
| 265 | static void deactivate_process (Lisp_Object); | 265 | static void deactivate_process (Lisp_Object); |
| @@ -5592,6 +5592,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5592 | nfds = pgtk_select (max_desc + 1, | 5592 | nfds = pgtk_select (max_desc + 1, |
| 5593 | &Available, (check_write ? &Writeok : 0), | 5593 | &Available, (check_write ? &Writeok : 0), |
| 5594 | NULL, &timeout, NULL); | 5594 | NULL, &timeout, NULL); |
| 5595 | #elif !defined USABLE_SIGIO && !defined WINDOWSNT | ||
| 5596 | /* If we're polling for input, don't get stuck in select for | ||
| 5597 | more than 25 msec. */ | ||
| 5598 | struct timespec short_timeout = make_timespec (0, 25000000); | ||
| 5599 | if ((read_kbd || !NILP (wait_for_cell)) | ||
| 5600 | && timespec_cmp (short_timeout, timeout) < 0) | ||
| 5601 | timeout = short_timeout; | ||
| 5595 | #elif defined HAVE_GLIB && !defined HAVE_NS | 5602 | #elif defined HAVE_GLIB && !defined HAVE_NS |
| 5596 | /* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c. */ | 5603 | /* Non-macOS HAVE_GLIB builds call thread_select in xgselect.c. */ |
| 5597 | nfds = xg_select (max_desc + 1, | 5604 | nfds = xg_select (max_desc + 1, |
| @@ -5725,7 +5732,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5725 | if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) | 5732 | if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) |
| 5726 | break; | 5733 | break; |
| 5727 | 5734 | ||
| 5728 | #ifdef USABLE_SIGIO | 5735 | #if defined (USABLE_SIGIO) || defined (USABLE_SIGPOLL) |
| 5729 | /* If we think we have keyboard input waiting, but didn't get SIGIO, | 5736 | /* If we think we have keyboard input waiting, but didn't get SIGIO, |
| 5730 | go read it. This can happen with X on BSD after logging out. | 5737 | go read it. This can happen with X on BSD after logging out. |
| 5731 | In that case, there really is no input and no SIGIO, | 5738 | In that case, there really is no input and no SIGIO, |
| @@ -5733,7 +5740,11 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5733 | 5740 | ||
| 5734 | if (read_kbd && interrupt_input | 5741 | if (read_kbd && interrupt_input |
| 5735 | && keyboard_bit_set (&Available) && ! noninteractive) | 5742 | && keyboard_bit_set (&Available) && ! noninteractive) |
| 5743 | #ifdef USABLE_SIGIO | ||
| 5736 | handle_input_available_signal (SIGIO); | 5744 | handle_input_available_signal (SIGIO); |
| 5745 | #else | ||
| 5746 | handle_input_available_signal (SIGPOLL); | ||
| 5747 | #endif | ||
| 5737 | #endif | 5748 | #endif |
| 5738 | 5749 | ||
| 5739 | /* If checking input just got us a size-change event from X, | 5750 | /* If checking input just got us a size-change event from X, |
| @@ -7727,7 +7738,7 @@ delete_gpm_wait_descriptor (int desc) | |||
| 7727 | 7738 | ||
| 7728 | # endif | 7739 | # endif |
| 7729 | 7740 | ||
| 7730 | # ifdef USABLE_SIGIO | 7741 | #if defined (USABLE_SIGIO) || defined (USABLE_SIGPOLL) |
| 7731 | 7742 | ||
| 7732 | /* Return true if *MASK has a bit set | 7743 | /* Return true if *MASK has a bit set |
| 7733 | that corresponds to one of the keyboard input descriptors. */ | 7744 | that corresponds to one of the keyboard input descriptors. */ |