diff src/mac.c @ 48818:5030a4c296d2

* 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.
author Steven Tamm <steventamm@mac.com>
date Thu, 12 Dec 2002 17:10:34 +0000
parents da833584a044
children 23a1cea22d13
line wrap: on
line diff
--- a/src/mac.c	Thu Dec 12 10:43:03 2002 +0000
+++ b/src/mac.c	Thu Dec 12 17:10:34 2002 +0000
@@ -2776,7 +2776,7 @@
   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 @@
 	{
 	  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 @@
 	  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);