From f3ba6a3e40d72e00d13e943d9338b60b4bee2e40 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 13 Dec 2022 15:44:17 -0500 Subject: tests: Add a test for readdir() errors --- tests/posix/readdir_error.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/posix/readdir_error.sh diff --git a/tests/posix/readdir_error.sh b/tests/posix/readdir_error.sh new file mode 100644 index 0000000..cca71f0 --- /dev/null +++ b/tests/posix/readdir_error.sh @@ -0,0 +1,21 @@ +clean_scratch +mkfifo scratch/{pid,hup} + +( + # Create a zombie process + echo >/dev/null & + # Write the PID to scratch/pid + echo $! >scratch/pid + # Don't wait on the processes + exec cat scratch/hup >/dev/null +) & + +# Kill cat on exit +trap "echo >scratch/hup" EXIT + +# Read the zombie PID +read -r pid /dev/null -- cgit v1.2.3