1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[select] Another try

Set fields of timeout manually.
This commit is contained in:
Witold Filipczyk 2023-12-20 20:31:13 +01:00
parent f91d214820
commit 8d0054041b

View File

@ -1215,7 +1215,8 @@ select_loop(void (*init)(void))
while (!program.terminate) { while (!program.terminate) {
struct timeval *timeout = NULL; struct timeval timeout = { 0, 0 };
struct timeval *timeout_ptr = NULL;
int n, i, has_timer; int n, i, has_timer;
timeval_T t; timeval_T t;
@ -1254,14 +1255,15 @@ select_loop(void (*init)(void))
} }
#endif #endif
#if 0
if (has_timer) { if (has_timer) {
/* Be sure timeout is not negative. */ /* Be sure timeout is not negative. */
timeval_limit_to_zero_or_one(&t); timeval_limit_to_zero_or_one(&t);
timeout = (struct timeval *) &t; timeout.tv_sec = t.sec;
timeout.tv_usec = t.usec;
timeout_ptr = &timeout;
} }
#endif
n = loop_select(w_max, &x_read, &x_write, &x_error, timeout); n = loop_select(w_max, &x_read, &x_write, &x_error, timeout_ptr);
if (n < 0) { if (n < 0) {
/* The following calls (especially gettext) /* The following calls (especially gettext)
* might change errno. */ * might change errno. */