aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.c
diff options
context:
space:
mode:
authorSteven Tamm2002-12-10 18:03:49 +0000
committerSteven Tamm2002-12-10 18:03:49 +0000
commit88069dff55bb8a074b8130485382ec2c283725f5 (patch)
tree8ee040215346e2b7c5747b3604e38438e147ee61 /src/mac.c
parentbdce610dee49649c2038af1aec3b92ee1e19bfd3 (diff)
downloademacs-88069dff55bb8a074b8130485382ec2c283725f5.tar.gz
emacs-88069dff55bb8a074b8130485382ec2c283725f5.zip
Modifying sys_read to not check the event queue if timeout=0 and to never
use a timeout larger than the one passed in.
Diffstat (limited to 'src/mac.c')
-rw-r--r--src/mac.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mac.c b/src/mac.c
index bf1915cbacd..e81007c4781 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -2769,7 +2769,9 @@ sys_select (n, rfds, wfds, efds, timeout)
2769{ 2769{
2770 if (!inhibit_window_system && rfds && FD_ISSET (0, rfds)) 2770 if (!inhibit_window_system && rfds && FD_ISSET (0, rfds))
2771 return 1; 2771 return 1;
2772 else if (inhibit_window_system || noninteractive) 2772 else if (inhibit_window_system || noninteractive ||
2773 (timeout && (EMACS_SECS(*timeout)==0) &&
2774 (EMACS_USECS(*timeout)==0)))
2773 return select(n, rfds, wfds, efds, timeout); 2775 return select(n, rfds, wfds, efds, timeout);
2774 else 2776 else
2775 { 2777 {
@@ -2787,6 +2789,9 @@ sys_select (n, rfds, wfds, efds, timeout)
2787 EMACS_SET_SECS (one_second, 1); 2789 EMACS_SET_SECS (one_second, 1);
2788 EMACS_SET_USECS (one_second, 0); 2790 EMACS_SET_USECS (one_second, 0);
2789 2791
2792 if (timeout && EMACS_TIME_LT(*timeout, one_second))
2793 one_second = *timeout;
2794
2790 if ((r = select (n, rfds, wfds, efds, &one_second)) > 0) 2795 if ((r = select (n, rfds, wfds, efds, &one_second)) > 0)
2791 return r; 2796 return r;
2792 2797