diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-02-22 20:19:28 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-02-22 20:19:28 +0300 |
commit | 0a286533559d03bff54b267f516910ff9336efa5 (patch) | |
tree | 83e5f1fca192e153ded1457fc20a832868cb4851 /internal | |
parent | 0c606eb9e920ed96d1a4a4a0d29364163569f5ca (diff) |
optimize worker i/o
Diffstat (limited to 'internal')
-rw-r--r-- | internal/worker.zsh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/worker.zsh b/internal/worker.zsh index 10d0c93a..6f6cb57e 100644 --- a/internal/worker.zsh +++ b/internal/worker.zsh @@ -50,9 +50,12 @@ function _p9k_worker_main() { else local REPLY= while true; do - sysread -i $fd 'REPLY[$#REPLY+1]' && continue - (( $? == 5 )) || return - break + if sysread -i $fd 'REPLY[$#REPLY+1]'; then + [[ $REPLY == *$'\x1e' ]] || continue + else + (( $? == 5 )) || return + break + fi done local cb=$_p9k_worker_fds[$fd] _p9k_worker_request_id=${cb%%$'\x1f'*} |