changeset 48793:da833584a044

Modifying sys_read to not check the event queue if timeout=0 and to never use a timeout larger than the one passed in.
author Steven Tamm <steventamm@mac.com>
date Tue, 10 Dec 2002 18:03:49 +0000
parents a3c07e71f333
children 837d37faadcf
files src/mac.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mac.c	Tue Dec 10 17:58:24 2002 +0000
+++ b/src/mac.c	Tue Dec 10 18:03:49 2002 +0000
@@ -2769,7 +2769,9 @@
 {
   if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))
     return 1;
-  else if (inhibit_window_system || noninteractive)
+  else if (inhibit_window_system || noninteractive ||
+	   (timeout && (EMACS_SECS(*timeout)==0) && 
+	    (EMACS_USECS(*timeout)==0)))
     return select(n, rfds, wfds, efds, timeout);
   else
     {
@@ -2787,6 +2789,9 @@
 	  EMACS_SET_SECS (one_second, 1);
 	  EMACS_SET_USECS (one_second, 0);
 	  
+	  if (timeout && EMACS_TIME_LT(*timeout, one_second))
+	    one_second = *timeout;
+
 	  if ((r = select (n, rfds, wfds, efds, &one_second)) > 0)
 	    return r;