From d18c9eadf0f3fa5a7ca67e360c43aaf2e7d12f1c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 11 Aug 2025 14:10:17 +0200 Subject: [PATCH] shells: testcase: add another test for EINTR on fifo open Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-redir/redir_EINTR2.right | 2 ++ shell/ash_test/ash-redir/redir_EINTR2.tests | 14 ++++++++++++++ shell/hush_test/hush-redir/redir_EINTR2.right | 2 ++ shell/hush_test/hush-redir/redir_EINTR2.tests | 14 ++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 shell/ash_test/ash-redir/redir_EINTR2.right create mode 100755 shell/ash_test/ash-redir/redir_EINTR2.tests create mode 100644 shell/hush_test/hush-redir/redir_EINTR2.right create mode 100755 shell/hush_test/hush-redir/redir_EINTR2.tests diff --git a/shell/ash_test/ash-redir/redir_EINTR2.right b/shell/ash_test/ash-redir/redir_EINTR2.right new file mode 100644 index 000000000..287d91f67 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_EINTR2.right @@ -0,0 +1,2 @@ +Hello +Done:0 diff --git a/shell/ash_test/ash-redir/redir_EINTR2.tests b/shell/ash_test/ash-redir/redir_EINTR2.tests new file mode 100755 index 000000000..3d343c7ea --- /dev/null +++ b/shell/ash_test/ash-redir/redir_EINTR2.tests @@ -0,0 +1,14 @@ +rm -f test.fifo +mkfifo test.fifo + +(sleep 1; kill -chld $$) & +(sleep 2; echo Hello >test.fifo) & + +# We get open("test.fifo") interrupted by SIGCHLD from the first subshell. +# The shell MUST retry the open (no printing of error messages). +# Then, the second subshell opens fifo for writing and open unblocks and succeeds. +read HELLO test.fifo) & + +# We get open("test.fifo") interrupted by SIGCHLD from the first subshell. +# The shell MUST retry the open (no printing of error messages). +# Then, the second subshell opens fifo for writing and open unblocks and succeeds. +read HELLO