mirror of
https://git.busybox.net/busybox
synced 2026-01-31 16:43:21 +00:00
shells: testcase: add another test for EINTR on fifo open
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
e660eab458
commit
d18c9eadf0
4 changed files with 32 additions and 0 deletions
2
shell/ash_test/ash-redir/redir_EINTR2.right
Normal file
2
shell/ash_test/ash-redir/redir_EINTR2.right
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Hello
|
||||
Done:0
|
||||
14
shell/ash_test/ash-redir/redir_EINTR2.tests
Executable file
14
shell/ash_test/ash-redir/redir_EINTR2.tests
Executable file
|
|
@ -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
|
||||
echo "$HELLO"
|
||||
|
||||
echo "Done:$?"
|
||||
rm -f test.fifo
|
||||
2
shell/hush_test/hush-redir/redir_EINTR2.right
Normal file
2
shell/hush_test/hush-redir/redir_EINTR2.right
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Hello
|
||||
Done:0
|
||||
14
shell/hush_test/hush-redir/redir_EINTR2.tests
Executable file
14
shell/hush_test/hush-redir/redir_EINTR2.tests
Executable file
|
|
@ -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
|
||||
echo "$HELLO"
|
||||
|
||||
echo "Done:$?"
|
||||
rm -f test.fifo
|
||||
Loading…
Reference in a new issue