diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:50 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:50 +0100 |
| commit | ff33e1d252f46bec1a33e28700da3282fc24047a (patch) | |
| tree | 5c15bc695be820b393a8496c5807ecafbbdeb89b /tests/pselect.c | |
| parent | b2ac982cc8b5290699eb5f52fb043d3d15e2624b (diff) | |
| parent | 5f59a34ab747dde8ede7357f3431bf06bd6002fe (diff) | |
Update upstream source from tag 'upstream/1.4.2'
Update to upstream version '1.4.2'
with Debian dir 493e96bcd865e4f9990e20bee26408c96231d727
Diffstat (limited to 'tests/pselect.c')
| -rw-r--r-- | tests/pselect.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/pselect.c b/tests/pselect.c index 78f0446f..0e6cff42 100644 --- a/tests/pselect.c +++ b/tests/pselect.c @@ -1,6 +1,6 @@ /* pselect - synchronous I/O multiplexing - Copyright 2011-2025 Free Software Foundation, Inc. + Copyright 2011-2026 Free Software Foundation, Inc. This file is part of gnulib. @@ -41,16 +41,14 @@ pselect (int nfds, fd_set *restrict rfds, struct timespec const *restrict timeout, sigset_t const *restrict sigmask) { - int select_result; - sigset_t origmask; - struct timeval tv, *tvp; - if (nfds < 0 || nfds > FD_SETSIZE) { errno = EINVAL; return -1; } + struct timeval tv; + struct timeval *tvp; if (timeout) { if (! (0 <= timeout->tv_nsec && timeout->tv_nsec < 1000000000)) @@ -68,12 +66,13 @@ pselect (int nfds, fd_set *restrict rfds, else tvp = NULL; + sigset_t origmask; /* Signal mask munging should be atomic, but this is the best we can do in this emulation. */ if (sigmask) pthread_sigmask (SIG_SETMASK, sigmask, &origmask); - select_result = select (nfds, rfds, wfds, xfds, tvp); + int select_result = select (nfds, rfds, wfds, xfds, tvp); if (sigmask) { @@ -95,15 +94,13 @@ rpl_pselect (int nfds, fd_set *restrict rfds, struct timespec const *restrict timeout, sigset_t const *restrict sigmask) { - int i; - /* FreeBSD 8.2 has a bug: it does not always detect invalid fds. */ if (nfds < 0 || nfds > FD_SETSIZE) { errno = EINVAL; return -1; } - for (i = 0; i < nfds; i++) + for (int i = 0; i < nfds; i++) { if (((rfds && FD_ISSET (i, rfds)) || (wfds && FD_ISSET (i, wfds)) |
