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:
John Hood
2016-11-06 01:13:36 -04:00
parent 795549aafb
commit 4bc9e5c6ab
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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
}