diff options
| author | Chong Yidong | 2012-11-03 23:44:59 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-11-03 23:44:59 +0800 |
| commit | 893cc4558558db41e16525303023372496a293b7 (patch) | |
| tree | 97c284fb1628a382cb1885997898e2ba437cccda /src | |
| parent | 0f7b074f4a6e8e6418d06ab6d3b206b4524381af (diff) | |
| download | emacs-893cc4558558db41e16525303023372496a293b7.tar.gz emacs-893cc4558558db41e16525303023372496a293b7.zip | |
Fix a race condition in wait_reading_process_output (tiny change).
* src/process.c (wait_reading_process_output): Avoid a race condition
with SIGIO delivery.
Fixes: debbugs:11536
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/process.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1595537267d..e26dd561495 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-11-03 Jim Paris <jim@jtan.com> (tiny change) | ||
| 2 | |||
| 3 | * process.c (wait_reading_process_output): Avoid a race condition | ||
| 4 | with SIGIO delivery (Bug#11536). | ||
| 5 | |||
| 1 | 2012-11-03 Chong Yidong <cyd@gnu.org> | 6 | 2012-11-03 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * buffer.c (cursor_type): Untabify docstring. | 8 | * buffer.c (cursor_type): Untabify docstring. |
diff --git a/src/process.c b/src/process.c index 77e99ead01f..dae687cb59c 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4697,9 +4697,12 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4697 | /* If we woke up due to SIGWINCH, actually change size now. */ | 4697 | /* If we woke up due to SIGWINCH, actually change size now. */ |
| 4698 | do_pending_window_change (0); | 4698 | do_pending_window_change (0); |
| 4699 | 4699 | ||
| 4700 | /* The following optimization fails if SIGIO is received between | ||
| 4701 | set_waiting_for_input and select (Bug#11536). | ||
| 4700 | if ((time_limit || nsecs) && nfds == 0 && ! timeout_reduced_for_timers) | 4702 | if ((time_limit || nsecs) && nfds == 0 && ! timeout_reduced_for_timers) |
| 4701 | /* We waited the full specified time, so return now. */ | ||
| 4702 | break; | 4703 | break; |
| 4704 | */ | ||
| 4705 | |||
| 4703 | if (nfds < 0) | 4706 | if (nfds < 0) |
| 4704 | { | 4707 | { |
| 4705 | if (xerrno == EINTR) | 4708 | if (xerrno == EINTR) |