improve pipe error messages

This commit is contained in:
John Gebbie 2023-01-25 17:47:12 +00:00
parent c427ab5394
commit c828f2d8ed
2 changed files with 3 additions and 3 deletions

View file

@ -14,11 +14,11 @@ fifo_being_read(){
p="${DOTOOL_PIPE:-/tmp/dotool_pipe}" p="${DOTOOL_PIPE:-/tmp/dotool_pipe}"
if [ -p "$p" ] && ! [ -w "$p" ]; then if [ -p "$p" ] && ! [ -w "$p" ]; then
echo 'dotoolc: the pipe does not grant write permission' printf %s\\n "dotoolc: the pipe does not grant write permission: $p" >&2
exit 1 exit 1
fi fi
if ! fifo_being_read "$p"; then if ! fifo_being_read "$p"; then
echo 'dotoolc: dotoold is not connected' >&2 printf %s\\n "dotoolc: no dotoold instance is reading the pipe: $p" >&2
exit 1 exit 1
fi fi
exec cat > "$p" exec cat > "$p"

View file

@ -14,7 +14,7 @@ fifo_being_read(){
p="${DOTOOL_PIPE:-/tmp/dotool_pipe}" p="${DOTOOL_PIPE:-/tmp/dotool_pipe}"
if fifo_being_read "$p" 2> /dev/null; then if fifo_being_read "$p" 2> /dev/null; then
echo 'dotoold: another instance is already connected' >&2 printf %s\\n "dotoold: another instance is already reading the pipe: $p" >&2
exit 1 exit 1
fi fi