aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-01-25 14:18:15 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-01-25 14:18:15 +0300
commite97a6c67014a1cc92187832fccd23dc7923c3e85 (patch)
tree80f6edeea0f4ba45fa590e536e755d690c18663a /internal
parent2dc56d0afefa639a0aa5bbdcbf051e6d1942f45c (diff)
delete fifo before killing worker from watchdog
Diffstat (limited to 'internal')
-rw-r--r--internal/worker.zsh8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/worker.zsh b/internal/worker.zsh
index 972b4a02..dad0bb74 100644
--- a/internal/worker.zsh
+++ b/internal/worker.zsh
@@ -3,7 +3,7 @@ function _p9k_worker_main() {
mkfifo $_p9k__worker_file_prefix.fifo || return
echo -nE - s$_p9k_worker_pgid$'\x1e' || return
exec 0<$_p9k__worker_file_prefix.fifo || return
- rm $_p9k__worker_file_prefix.fifo || return
+ zf_rm $_p9k__worker_file_prefix.fifo || return
typeset -g IFS=$' \t\n\0'
@@ -108,6 +108,7 @@ function _p9k_worker_stop() {
[[ -n $_p9k__worker_resp_fd ]] && exec {_p9k__worker_resp_fd}>&-
[[ -n $_p9k__worker_req_fd ]] && exec {_p9k__worker_req_fd}>&-
[[ -n $_p9k__worker_pid ]] && kill -- -$_p9k__worker_pid 2>/dev/null
+ [[ -n $_p9k__worker_file_prefix ]] && zf_rm -f $_p9k__worker_file_prefix.fifo
_p9k__worker_pid=
_p9k__worker_req_fd=
_p9k__worker_resp_fd=
@@ -205,6 +206,7 @@ function _p9k_worker_start() {
{
trap '' PIPE
while syswrite $'\x05'; do zselect -t 1000; done
+ zf_rm -f $_p9k__worker_file_prefix.fifo
kill -- -$_p9k_worker_pgid
} &
exec =true) || return
@@ -230,11 +232,13 @@ emulate -L zsh -o prompt_subst -o interactive_comments # -o xtrace
zmodload zsh/datetime
zmodload zsh/system
+zmodload -F zsh/files b:zf_mv b:zf_rm
+
autoload -Uz add-zsh-hook
function foo_compute() {
_p9k_worker_reply 'echo sync latency: $((1000*(EPOCHREALTIME-'$1'))) >>/tmp/log'
- _p9k_worker_async foo_async "foo_sync $1"
+ # _p9k_worker_async foo_async "foo_sync $1"
}
function foo_async() {