2770 |
if (!inhibit_window_system && rfds && FD_ISSET (0, rfds)) |
if (!inhibit_window_system && rfds && FD_ISSET (0, rfds)) |
2771 |
return 1; |
return 1; |
2772 |
else if (inhibit_window_system || noninteractive || |
else if (inhibit_window_system || noninteractive || |
2773 |
(timeout && (EMACS_SECS(*timeout)==0) && |
(timeout && (EMACS_SECS(*timeout)==0) && |
2774 |
(EMACS_USECS(*timeout)==0))) |
(EMACS_USECS(*timeout)==0))) |
2775 |
return select(n, rfds, wfds, efds, timeout); |
return select(n, rfds, wfds, efds, timeout); |
2776 |
else |
else |
2780 |
EMACS_GET_TIME (end_time); |
EMACS_GET_TIME (end_time); |
2781 |
if (timeout) |
if (timeout) |
2782 |
EMACS_ADD_TIME (end_time, end_time, *timeout); |
EMACS_ADD_TIME (end_time, end_time, *timeout); |
2783 |
|
|
2784 |
do |
do |
2785 |
{ |
{ |
2786 |
int r; |
int r; |
2787 |
EMACS_TIME one_second; |
EMACS_TIME one_second; |
2788 |
SELECT_TYPE orfds; |
SELECT_TYPE orfds; |
2789 |
|
|
2790 |
FD_ZERO (&orfds); |
FD_ZERO (&orfds); |
2791 |
if (rfds) |
if (rfds) |
2792 |
{ |
{ |
2793 |
orfds = *rfds; |
orfds = *rfds; |
2794 |
} |
} |
2795 |
|
|
2796 |
EMACS_SET_SECS (one_second, 1); |
EMACS_SET_SECS (one_second, 1); |
2797 |
EMACS_SET_USECS (one_second, 0); |
EMACS_SET_USECS (one_second, 0); |
2798 |
|
|
2799 |
if (timeout && EMACS_TIME_LT(*timeout, one_second)) |
if (timeout && EMACS_TIME_LT(*timeout, one_second)) |
2800 |
one_second = *timeout; |
one_second = *timeout; |
2801 |
|
|
2806 |
} |
} |
2807 |
|
|
2808 |
mac_check_for_quit_char(); |
mac_check_for_quit_char(); |
2809 |
|
|
2810 |
EMACS_GET_TIME (now); |
EMACS_GET_TIME (now); |
2811 |
EMACS_SUB_TIME (now, end_time, now); |
EMACS_SUB_TIME (now, end_time, now); |
2812 |
} |
} |
2813 |
while (!timeout || !EMACS_TIME_NEG_P (now)); |
while (!timeout || !EMACS_TIME_NEG_P (now)); |
2814 |
|
|
2815 |
return 0; |
return 0; |
2816 |
} |
} |
2817 |
} |
} |
2835 |
if (sys_select (fds+1, &rfds, 0, 0, NULL) < 0) |
if (sys_select (fds+1, &rfds, 0, 0, NULL) < 0) |
2836 |
return -1; |
return -1; |
2837 |
} |
} |
2838 |
|
|
2839 |
return read (fds, buf, nbyte); |
return read (fds, buf, nbyte); |
2840 |
} |
} |
2841 |
|
|