Bash-5.2 patch 35: fix compilation on systems that provide select or pselect but not both

This commit is contained in:
Chet Ramey
2024-09-23 18:16:27 -04:00
parent 2abedfbddb
commit 315ca61c0c
4 changed files with 8 additions and 1376 deletions
+4 -2
View File
@@ -151,7 +151,9 @@ int rl_timeout_remaining (unsigned int *, unsigned int *);
int _rl_timeout_init (void);
int _rl_timeout_sigalrm_handler (void);
#if defined (RL_TIMEOUT_USE_SELECT)
int _rl_timeout_select (int, fd_set *, fd_set *, fd_set *, const struct timeval *, const sigset_t *);
#endif
static void _rl_timeout_handle (void);
#if defined (RL_TIMEOUT_USE_SIGALRM)
@@ -248,7 +250,7 @@ rl_gather_tyi (void)
register int tem, result;
int chars_avail, k;
char input;
#if defined(HAVE_SELECT)
#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
fd_set readfds, exceptfds;
struct timeval timeout;
#endif
@@ -805,7 +807,7 @@ rl_getc (FILE *stream)
int result;
unsigned char c;
int fd;
#if defined (HAVE_PSELECT)
#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
sigset_t empty_set;
fd_set readfds;
#endif
File diff suppressed because it is too large Load Diff
+3 -9
View File
@@ -33,9 +33,7 @@
# include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#if defined (HAVE_PSELECT)
# include <signal.h>
#endif
#include <signal.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
@@ -107,10 +105,8 @@ nchars_avail (fd, nchars)
int nchars;
{
int result, chars_avail;
#if defined(HAVE_SELECT)
fd_set readfds, exceptfds;
#endif
#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
fd_set readfds, exceptfds;
sigset_t set, oset;
#endif
@@ -121,13 +117,11 @@ nchars_avail (fd, nchars)
chars_avail = 0;
#if defined (HAVE_SELECT)
#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
FD_ZERO (&readfds);
FD_ZERO (&exceptfds);
FD_SET (fd, &readfds);
FD_SET (fd, &exceptfds);
#endif
#if defined (HAVE_SELECT) || defined (HAVE_PSELECT)
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
# ifdef SIGCHLD
sigaddset (&set, SIGCHLD);
+1 -1
View File
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
#define PATCHLEVEL 34
#define PATCHLEVEL 35
#endif /* _PATCHLEVEL_H_ */