From 67d8b3ffb7bceb3492920c311e966b605c8ba182 Mon Sep 17 00:00:00 2001 From: Jesse Gardner Date: Thu, 15 Apr 2021 19:21:53 -0700 Subject: [PATCH] Not sure why open_pipe made a temp directory, now it makes a temp file instead --- qq2clone | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qq2clone b/qq2clone index 1f0102a..b29426c 100755 --- a/qq2clone +++ b/qq2clone @@ -60,11 +60,10 @@ open_pipe () #=========================================================================# { check_pipe && return -local TEMPDIR -TEMPDIR=$(mktemp -d) || temp_error +local fifo_path +fifo_path=$(mktemp) || temp_error #shellcheck disable=2064 -trap "exec 3>&-; exec 3<&-;rm -rf $TEMPDIR" EXIT -fifo_path="${TEMPDIR}/qq2clone_fifo" +trap "exec 3>&-; exec 3<&-;rm -f $fifo_path" EXIT mkfifo "$fifo_path" || fifo_error exec 3<>"$fifo_path" return 0 @@ -110,7 +109,7 @@ write_pipe () { # We put a + at the beginning of every line to let read_pipe work in a # non-blocking manner - local line +local line if (($1)); then while IFS= read -r line; do echo "+$line" >&3