read builtin timeouts no longer use SIGALRM

This commit is contained in:
Chet Ramey
2021-03-10 17:15:44 -05:00
parent 11bf534f36
commit 128c5d41b0
16 changed files with 159 additions and 183 deletions
+1
View File
@@ -906,6 +906,7 @@ extern int rl_persistent_signal_handlers;
#define RL_STATE_REDISPLAYING 0x1000000 /* updating terminal display */
#define RL_STATE_DONE 0x2000000 /* done; accepted line */
#define RL_STATE_TIMEOUT 0x4000000 /* readline() timed out */
#define RL_SETSTATE(x) (rl_readline_state |= (x))
#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
+3 -1
View File
@@ -46,6 +46,7 @@ extern int executing_builtin;
extern void check_signals_and_traps (void);
extern void check_signals (void);
extern int signal_is_trapped (int);
extern int read_builtin_timeout (int);
/* Read LEN bytes from FD into BUF. Retry the read on EINTR. Any other
error causes the loop to break. */
@@ -58,7 +59,8 @@ zread (fd, buf, len)
ssize_t r;
check_signals (); /* check for signals before a blocking read */
while ((r = read (fd, buf, len)) < 0 && errno == EINTR)
while (((r = read_builtin_timeout (fd)) < 0 || (r = read (fd, buf, len)) < 0) &&
errno == EINTR)
{
int t;
t = errno;