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
|
sleep 1
|
||||||
printf "send-keys 0x04\n"
|
printf "send-keys 0x04\n"
|
||||||
# This will get killed by SIGPIPE.
|
# This will get killed by SIGPIPE.
|
||||||
while sleep 1; do
|
while printf "show-options\n"; do
|
||||||
printf "show-options\n"
|
sleep 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ tmux_commands()
|
|||||||
# And stop the test script, so it produces its exit messge.
|
# And stop the test script, so it produces its exit messge.
|
||||||
printf "send-keys 0x0d\n"
|
printf "send-keys 0x0d\n"
|
||||||
# This will get killed by SIGPIPE.
|
# This will get killed by SIGPIPE.
|
||||||
while sleep 1; do
|
while printf "show-options\n"; do
|
||||||
printf "show-options\n"
|
sleep 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user