Skip to content

Commit

Permalink
Check named pipe existence for preventing "No such file ro directory"…
Browse files Browse the repository at this point in the history
… error
  • Loading branch information
makenowjust committed Jan 10, 2020
1 parent a6463da commit 5260479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bashcached
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ else
trap 'rm -f "$BASHCACHED_PIPE"' EXIT
(( ${check-60} != 0 )) && while echo; do sleep "${check-60}"; done >"$BASHCACHED_PIPE" &

while true; do cat "$BASHCACHED_PIPE"; done | while read -r line; do
while [[ -p "$BASHCACHED_PIPE" ]]; do cat "$BASHCACHED_PIPE" 2>/dev/null; done | while read -r line; do
cmd='' recv='' send=; eval "$line"; read -ra cmd<<<"$cmd"; time=$(printf '%(%s)T' -1)
(( time - before >= ${check-60} )) && for k in "${!exptime[@]}"; do
! cache_has $k && cache_delete $k; done && before=$time
Expand Down

0 comments on commit 5260479

Please sign in to comment.