reverted open_pipe's previous temp directory behavior (mkfifo can't overwrite empty file)

This commit is contained in:
Jesse Gardner 2021-04-25 20:45:13 -07:00
parent a64ae8f0f4
commit cd007a6716
1 changed files with 4 additions and 4 deletions

View File

@ -61,11 +61,11 @@ open_pipe ()
{
check_pipe && return
local fifo_path
fifo_path=$(mktemp) || temp_error
fifo_path=$(mktemp -d) || temp_error
#shellcheck disable=2064
trap "exec 3>&-; exec 3<&-;rm -f $fifo_path" EXIT
mkfifo "$fifo_path" || fifo_error
exec 3<>"$fifo_path"
trap "exec 3>&-; exec 3<&-;rm -rf $fifo_path" EXIT
mkfifo "$fifo_path/fifo" || fifo_error
exec 3<>"$fifo_path/fifo"
return 0
}
#=========================================================================#