Handle printing to closed pipes better in tests.
Some systems do not deliver SIGPIPE to shell pipeline writers when the downstream reader has exited. So, also check for errors from /bin/printf. I fixed this for OpenBSD 6.0 but I think it will also fix posh on Linux.
This commit is contained in:
@@ -52,8 +52,8 @@ tmux_commands()
|
||||
sleep 1
|
||||
printf "send-keys 0x04\n"
|
||||
# This will get killed by SIGPIPE.
|
||||
while sleep 1; do
|
||||
printf "show-options\n"
|
||||
while printf "show-options\n"; do
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ tmux_commands()
|
||||
# And stop the test script, so it produces its exit messge.
|
||||
printf "send-keys 0x0d\n"
|
||||
# This will get killed by SIGPIPE.
|
||||
while sleep 1; do
|
||||
printf "show-options\n"
|
||||
while printf "show-options\n"; do
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user