Fix #3957
If the session wasn't valid anymore by the time the linter finishes, writing to "$dir"/fifo would hang forever leaving temporary files in /tmp/kak-lint.XXX and the process alive. This commit fixes that by not writing to the fifo if the session was not valid. throwawayaccount12345-1 Copyright Waiver I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
This commit is contained in:
parent
c30a0e0ca2
commit
719b23c54f
|
@ -209,11 +209,11 @@ define-command \
|
||||||
|
|
||||||
# A fifo to send the results back to a Kakoune buffer.
|
# A fifo to send the results back to a Kakoune buffer.
|
||||||
mkfifo "$dir"/fifo
|
mkfifo "$dir"/fifo
|
||||||
printf 'lint-open-output-buffer %s' "$(kakquote "$dir")" | kak -p "$kak_session"
|
# Send the results to kakoune if the session is still valid.
|
||||||
|
if printf 'lint-open-output-buffer %s' "$(kakquote "$dir")" | kak -p "$kak_session"; then
|
||||||
# We are done here. Send the results to Kakoune,
|
|
||||||
# and clean up.
|
|
||||||
cat "$dir"/result > "$dir"/fifo
|
cat "$dir"/result > "$dir"/fifo
|
||||||
|
fi
|
||||||
|
# Clean up.
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
|
|
||||||
} & ) >"$dir"/stderr 2>&1 </dev/null
|
} & ) >"$dir"/stderr 2>&1 </dev/null
|
||||||
|
|
Loading…
Reference in New Issue
Block a user