summaryrefslogtreecommitdiff
path: root/src/mac.c
diff options
context:
space:
mode:
authorSteven Tamm <steventamm@mac.com>2002-12-12 17:10:34 +0000
committerSteven Tamm <steventamm@mac.com>2002-12-12 17:10:34 +0000
commit96720f09ea540774b650385a2d56a789fadbe972 (patch)
treece31e82b138df861ed0a682385f581a5227fd869 /src/mac.c
parent2bfe1b7a8f6e2b2e00b9be9b4feb8ef347e40520 (diff)
downloademacs-96720f09ea540774b650385a2d56a789fadbe972.tar.gz
* macterm.c (mac_check_for_quit_char): Correctly set the
modifiers of the event to 0. * mac.c (sys_select): Duplicate rfds before calling select to ensure that rfds survive the while loop.
Diffstat (limited to 'src/mac.c')
-rw-r--r--src/mac.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mac.c b/src/mac.c
index e81007c4781..bc2d342b197 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -2776,7 +2776,7 @@ sys_select (n, rfds, wfds, efds, timeout)
else
{
EMACS_TIME end_time, now;
-
+
EMACS_GET_TIME (end_time);
if (timeout)
EMACS_ADD_TIME (end_time, end_time, *timeout);
@@ -2785,6 +2785,13 @@ sys_select (n, rfds, wfds, efds, timeout)
{
int r;
EMACS_TIME one_second;
+ SELECT_TYPE orfds;
+
+ FD_ZERO (&orfds);
+ if (rfds)
+ {
+ orfds = *rfds;
+ }
EMACS_SET_SECS (one_second, 1);
EMACS_SET_USECS (one_second, 0);
@@ -2792,9 +2799,12 @@ sys_select (n, rfds, wfds, efds, timeout)
if (timeout && EMACS_TIME_LT(*timeout, one_second))
one_second = *timeout;
- if ((r = select (n, rfds, wfds, efds, &one_second)) > 0)
- return r;
-
+ if ((r = select (n, &orfds, wfds, efds, &one_second)) > 0)
+ {
+ *rfds = orfds;
+ return r;
+ }
+
mac_check_for_quit_char();
EMACS_GET_TIME (now);