improve pipe error messages
This commit is contained in:
parent
c427ab5394
commit
c828f2d8ed
2 changed files with 3 additions and 3 deletions
4
dotoolc
4
dotoolc
|
@ -14,11 +14,11 @@ fifo_being_read(){
|
|||
p="${DOTOOL_PIPE:-/tmp/dotool_pipe}"
|
||||
|
||||
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
|
||||
fi
|
||||
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
|
||||
fi
|
||||
exec cat > "$p"
|
||||
|
|
2
dotoold
2
dotoold
|
@ -14,7 +14,7 @@ fifo_being_read(){
|
|||
p="${DOTOOL_PIPE:-/tmp/dotool_pipe}"
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue