mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Merge pull request #17403 from lllusion3469/patch-1
Change atom.sh not to spawn a sleep process every second on --wait
This commit is contained in:
9
atom.sh
9
atom.sh
@@ -148,6 +148,15 @@ trap 'on_die' SIGQUIT SIGTERM
|
||||
|
||||
# If the wait flag is set, don't exit this process until Atom tells it to.
|
||||
if [ $WAIT ]; then
|
||||
WAIT_FIFO="$ATOM_HOME/.wait_fifo"
|
||||
while true; do
|
||||
[ -f "$WAIT_FIFO" ] && rm "$WAIT_FIFO"
|
||||
[ ! -p "$WAIT_FIFO" ] && mkfifo "$WAIT_FIFO"
|
||||
read < "$WAIT_FIFO" || break
|
||||
sleep 1 # prevent a tight loop
|
||||
done
|
||||
|
||||
# fall back to sleep
|
||||
while true; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user