freebsd-src/bin
Dag-Erling Smørgrav 3c2643a7db
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
sh: Don't assume EINTR means SIGALRM
While waiting for input in the read builtin, if select() is interrupted
but there is no pending signal, we act like we timed out, and return the
same status as if we had been interrupted by SIGALRM, instead of looping
until we actually do time out.

* Replace the single select() call with a ppoll() loop.

* Improve validation of the timeout value.  We now accept things like
  "1h30m15s", which we used to silently truncate to "1h".  The flip side
  is that we no longer accept things like "1hour" or "5sec".

* Modify the existing `read -t 0` test case to verify that read returns
  immediately when there is input and fails immediately when there isn't.

* Add a second test case which performs the same tests with a non-zero
  timeout value.

PR:		290844
MFC after:	1 week
Fixes:          c4539460e3 ("sh: Improve error handling in read builtin:")
Reviewed by:	jilles, bdrewery
Differential Revision:	https://reviews.freebsd.org/D53761
2025-11-19 11:43:59 +01:00
..
cat bin/cat: add test for reading data from stdin 2025-06-13 08:25:54 -06:00
chflags Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
chio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
chmod Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
cp cp: Simplify sameness checks 2025-10-07 18:23:58 +02:00
cpuset libutil: Move cpuset(1) domain policy parsing code into libutil 2025-07-27 18:31:48 +02:00
csh csh: Remove gethost dependency on tc.const.h 2025-02-08 19:30:55 -05:00
date date: Improve nanosecond support 2025-11-11 15:58:35 +01:00
dd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
df manpages: prefer linking to xo_options.7 over xo_parse_args.3 2025-07-16 12:02:24 -06:00
domainname Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
echo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ed Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
expr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
freebsd-version Fix grammar in freebsd-version(1) 2025-08-27 14:31:01 +00:00
getfacl getfacl: implement --skip-base (-s) 2025-04-20 22:57:45 -05:00
hostname tests: Switch bin/hostname/hostname_test to execenv=jail 2024-10-31 17:44:49 +00:00
kenv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
kill kill: Fix support for kill -0 2025-06-20 22:24:10 +00:00
ln ln: Simplify sameness checks 2025-10-07 18:23:58 +02:00
ls ls: --group-directories requires stat information 2025-01-22 08:29:29 +01:00
mkdir Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mv mv: Add test cases for command-line options. 2024-11-19 10:29:15 +01:00
nproc Update Makefile.depend files 2024-10-14 10:26:17 -07:00
pax pax: Clear arcn in each read function. 2024-07-24 22:07:06 +02:00
pkill pkill: better document ancestor-hiding 2025-06-24 09:49:31 -05:00
ps manpages: prefer linking to xo_options.7 over xo_parse_args.3 2025-07-16 12:02:24 -06:00
pwait pwait: Add an option to print remaining processes 2025-10-28 12:57:16 +01:00
pwd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
realpath Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rm rm(1): remove whiteouts when forcibly removing directories 2025-11-08 21:47:15 -06:00
rmail Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rmdir manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
setfacl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
sh sh: Don't assume EINTR means SIGALRM 2025-11-19 11:43:59 +01:00
sleep Update Makefile.depend files 2024-10-14 10:26:17 -07:00
stty Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
sync Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
test test(1): quote closing bracket in error message 2024-07-29 14:08:33 -06:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
timeout timeout(1): add license header to unit test 2025-09-03 11:52:46 +02:00
uuidgen uuidgen.1: Correct SYNOPSIS, alphabetize options 2025-08-27 12:17:42 -04:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00