summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-misc.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-03-13 17:37:53 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2009-03-13 17:37:53 +0100
commit9b9ad8567f1246322904ee2a603b7e6f7f69c768 (patch)
tree2e56116992c23669944b984ad7eaa6d99707dafa /src/core/libs/lib-misc.sh
parent99b804fdc73c3aec225205792493cd67b68ff16d (diff)
fix for kill dialogs forked process from the follow_progress call in wait_for
Diffstat (limited to 'src/core/libs/lib-misc.sh')
-rw-r--r--src/core/libs/lib-misc.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index 0b77d93..9ce0fd8 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -34,6 +34,7 @@ run_background ()
# wait until a process is done
# $1 identifier. WARNING! see above
+# $2 pid of a process to kill when done (optional). useful for dialog --no-kill --tailboxbg's pid.
wait_for ()
{
[ -z "$1" ] && die_error "wait_for needs an identifier to known on which command to wait!"
@@ -43,7 +44,7 @@ wait_for ()
sleep 1
done
- kill $(cat $ANSWER) #TODO: this may not work when mode = cli (<--i wrote this before i used tail -f --pid. i don't remember what i meant with it). TODO: huh?? ANSWER?
+ [ -n "$2" ] && kill $2
}