[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 8a2dbf9f86: Fix pselect usage mistakes
From: |
Po Lu |
Subject: |
master 8a2dbf9f86: Fix pselect usage mistakes |
Date: |
Wed, 1 Jun 2022 00:52:02 -0400 (EDT) |
branch: master
commit 8a2dbf9f86f0c79c0e5c5c528ddcb6a5e3d89c00
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix pselect usage mistakes
* src/xterm.c (x_next_event_from_any_display):
(x_wait_for_cell_change): Fix calls to pselect and tests against
return value.
---
src/xterm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index f062e6485d..2421108a41 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10322,7 +10322,7 @@ x_next_event_from_any_display (XEvent *event)
/* We don't have to check the return of pselect, because if an
error occurs XPending will call the IO error handler, which
then brings us out of this loop. */
- pselect (maxfd, &fds, NULL, NULL, NULL, NULL);
+ pselect (maxfd + 1, &fds, NULL, NULL, NULL, NULL);
}
}
@@ -14945,12 +14945,12 @@ x_wait_for_cell_change (Lisp_Object cell, struct
timespec timeout)
timeout = timespec_sub (at, current);
#ifndef USE_GTK
- rc = pselect (maxfd, &fds, NULL, NULL, &timeout, NULL);
+ rc = pselect (maxfd + 1, &fds, NULL, NULL, &timeout, NULL);
- if (rc > 0)
+ if (rc >= 0)
rfds = fds;
#else
- pselect (maxfd, &fds, NULL, NULL, &timeout, NULL);
+ pselect (maxfd + 1, &fds, NULL, NULL, &timeout, NULL);
#endif
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 8a2dbf9f86: Fix pselect usage mistakes,
Po Lu <=