diff options
| author | Miles Bader | 2007-05-24 21:31:10 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-05-24 21:31:10 +0000 |
| commit | 262be72a9aaa800d38cd25b12acb8c9b7b21d5d6 (patch) | |
| tree | 0940ebc7acd6379243e7194446acbd4f062be4f3 /src/process.c | |
| parent | 5e1d0c0a38c22adc02d1b77bdc1d620fab26e52d (diff) | |
| parent | a02a3c235e3ec24acaf2014e6c60c0b4138ff86f (diff) | |
| download | emacs-262be72a9aaa800d38cd25b12acb8c9b7b21d5d6.tar.gz emacs-262be72a9aaa800d38cd25b12acb8c9b7b21d5d6.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 751-770)
- Update from CVS
- Merge from emacs--rel--22
- Update from CVS: lisp/textmodes/sgml-mode.el: Revert last change.
- Merge from gnus--rel--5.10
* emacs--rel--22 (patch 18-25)
* gnus--rel--5.10 (patch 222-223)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-208
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c index 567aae7c08f..be88ba25123 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -328,14 +328,18 @@ extern int timers_run; | |||
| 328 | 328 | ||
| 329 | static SELECT_TYPE input_wait_mask; | 329 | static SELECT_TYPE input_wait_mask; |
| 330 | 330 | ||
| 331 | /* Mask that excludes keyboard input descriptor (s). */ | 331 | /* Mask that excludes keyboard input descriptor(s). */ |
| 332 | 332 | ||
| 333 | static SELECT_TYPE non_keyboard_wait_mask; | 333 | static SELECT_TYPE non_keyboard_wait_mask; |
| 334 | 334 | ||
| 335 | /* Mask that excludes process input descriptor (s). */ | 335 | /* Mask that excludes process input descriptor(s). */ |
| 336 | 336 | ||
| 337 | static SELECT_TYPE non_process_wait_mask; | 337 | static SELECT_TYPE non_process_wait_mask; |
| 338 | 338 | ||
| 339 | /* Mask for the gpm mouse input descriptor. */ | ||
| 340 | |||
| 341 | static SELECT_TYPE gpm_wait_mask; | ||
| 342 | |||
| 339 | #ifdef NON_BLOCKING_CONNECT | 343 | #ifdef NON_BLOCKING_CONNECT |
| 340 | /* Mask of bits indicating the descriptors that we wait for connect to | 344 | /* Mask of bits indicating the descriptors that we wait for connect to |
| 341 | complete on. Once they complete, they are removed from this mask | 345 | complete on. Once they complete, they are removed from this mask |
| @@ -357,6 +361,9 @@ static int max_process_desc; | |||
| 357 | /* The largest descriptor currently in use for keyboard input. */ | 361 | /* The largest descriptor currently in use for keyboard input. */ |
| 358 | static int max_keyboard_desc; | 362 | static int max_keyboard_desc; |
| 359 | 363 | ||
| 364 | /* The largest descriptor currently in use for gpm mouse input. */ | ||
| 365 | static int max_gpm_desc; | ||
| 366 | |||
| 360 | /* Nonzero means delete a process right away if it exits. */ | 367 | /* Nonzero means delete a process right away if it exits. */ |
| 361 | static int delete_exited_processes; | 368 | static int delete_exited_processes; |
| 362 | 369 | ||
| @@ -4445,7 +4452,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4445 | IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask); | 4452 | IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask); |
| 4446 | 4453 | ||
| 4447 | EMACS_SET_SECS_USECS (timeout, 0, 0); | 4454 | EMACS_SET_SECS_USECS (timeout, 0, 0); |
| 4448 | if ((select (max (max_process_desc, max_keyboard_desc) + 1, | 4455 | if ((select (max (max (max_process_desc, max_keyboard_desc), |
| 4456 | max_gpm_desc) + 1, | ||
| 4449 | &Atemp, | 4457 | &Atemp, |
| 4450 | #ifdef NON_BLOCKING_CONNECT | 4458 | #ifdef NON_BLOCKING_CONNECT |
| 4451 | (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0), | 4459 | (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0), |
| @@ -4590,7 +4598,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4590 | } | 4598 | } |
| 4591 | #endif | 4599 | #endif |
| 4592 | 4600 | ||
| 4593 | nfds = select (max (max_process_desc, max_keyboard_desc) + 1, | 4601 | nfds = select (max (max (max_process_desc, max_keyboard_desc), |
| 4602 | max_gpm_desc) + 1, | ||
| 4594 | &Available, | 4603 | &Available, |
| 4595 | #ifdef NON_BLOCKING_CONNECT | 4604 | #ifdef NON_BLOCKING_CONNECT |
| 4596 | (check_connect ? &Connecting : (SELECT_TYPE *)0), | 4605 | (check_connect ? &Connecting : (SELECT_TYPE *)0), |
| @@ -6884,6 +6893,21 @@ add_keyboard_wait_descriptor (desc) | |||
| 6884 | max_keyboard_desc = desc; | 6893 | max_keyboard_desc = desc; |
| 6885 | } | 6894 | } |
| 6886 | 6895 | ||
| 6896 | static int add_gpm_wait_descriptor_called_flag; | ||
| 6897 | |||
| 6898 | void | ||
| 6899 | add_gpm_wait_descriptor (desc) | ||
| 6900 | int desc; | ||
| 6901 | { | ||
| 6902 | if (! add_gpm_wait_descriptor_called_flag) | ||
| 6903 | FD_CLR (0, &input_wait_mask); | ||
| 6904 | add_gpm_wait_descriptor_called_flag = 1; | ||
| 6905 | FD_SET (desc, &input_wait_mask); | ||
| 6906 | FD_SET (desc, &gpm_wait_mask); | ||
| 6907 | if (desc > max_gpm_desc) | ||
| 6908 | max_gpm_desc = desc; | ||
| 6909 | } | ||
| 6910 | |||
| 6887 | /* From now on, do not expect DESC to give keyboard input. */ | 6911 | /* From now on, do not expect DESC to give keyboard input. */ |
| 6888 | 6912 | ||
| 6889 | void | 6913 | void |
| @@ -6899,10 +6923,29 @@ delete_keyboard_wait_descriptor (desc) | |||
| 6899 | if (desc == max_keyboard_desc) | 6923 | if (desc == max_keyboard_desc) |
| 6900 | for (fd = 0; fd < lim; fd++) | 6924 | for (fd = 0; fd < lim; fd++) |
| 6901 | if (FD_ISSET (fd, &input_wait_mask) | 6925 | if (FD_ISSET (fd, &input_wait_mask) |
| 6902 | && !FD_ISSET (fd, &non_keyboard_wait_mask)) | 6926 | && !FD_ISSET (fd, &non_keyboard_wait_mask) |
| 6927 | && !FD_ISSET (fd, &gpm_wait_mask)) | ||
| 6903 | max_keyboard_desc = fd; | 6928 | max_keyboard_desc = fd; |
| 6904 | } | 6929 | } |
| 6905 | 6930 | ||
| 6931 | void | ||
| 6932 | delete_gpm_wait_descriptor (desc) | ||
| 6933 | int desc; | ||
| 6934 | { | ||
| 6935 | int fd; | ||
| 6936 | int lim = max_gpm_desc; | ||
| 6937 | |||
| 6938 | FD_CLR (desc, &input_wait_mask); | ||
| 6939 | FD_CLR (desc, &non_process_wait_mask); | ||
| 6940 | |||
| 6941 | if (desc == max_gpm_desc) | ||
| 6942 | for (fd = 0; fd < lim; fd++) | ||
| 6943 | if (FD_ISSET (fd, &input_wait_mask) | ||
| 6944 | && !FD_ISSET (fd, &non_keyboard_wait_mask) | ||
| 6945 | && !FD_ISSET (fd, &non_process_wait_mask)) | ||
| 6946 | max_gpm_desc = fd; | ||
| 6947 | } | ||
| 6948 | |||
| 6906 | /* Return nonzero if *MASK has a bit set | 6949 | /* Return nonzero if *MASK has a bit set |
| 6907 | that corresponds to one of the keyboard input descriptors. */ | 6950 | that corresponds to one of the keyboard input descriptors. */ |
| 6908 | 6951 | ||