* macterm.c (mac_check_for_quit_char): Correctly set the
authorSteven Tamm <steventamm@mac.com>
Thu, 12 Dec 2002 17:10:34 +0000 (17:10 +0000)
committerSteven Tamm <steventamm@mac.com>
Thu, 12 Dec 2002 17:10:34 +0000 (17:10 +0000)
modifiers of the event to 0.
* mac.c (sys_select): Duplicate rfds before calling select to
ensure that rfds survive the while loop.

src/ChangeLog
src/mac.c
src/macterm.c

index d057003..24970fa 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-12  Steven Tamm  <steventamm@mac.com>
+
+       * 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.
+
 2002-12-11  Kim F. Storm  <storm@cua.dk>
 
        * xdisp.c (try_window_id): Don't call set_cursor_from_row if
index e81007c..bc2d342 100644 (file)
--- 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);
index 0fb6442..d229952 100644 (file)
@@ -13561,6 +13561,8 @@ mac_check_for_quit_char()
       /* Use an input_event to emulate what the interrupt handler does. */
       e.kind = ASCII_KEYSTROKE_EVENT;
       e.code = quit_char;
+      e.arg = NULL;
+      e.modifiers = NULL;
       e.timestamp = EventTimeToTicks(GetEventTime(event))*(1000/60);
       XSETFRAME(e.frame_or_window, mwp->mFP);
       /* Remove event from queue to prevent looping. */