From 9b9ad8567f1246322904ee2a603b7e6f7f69c768 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 13 Mar 2009 17:37:53 +0100 Subject: fix for kill dialogs forked process from the follow_progress call in wait_for --- src/core/libs/lib-misc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/libs/lib-misc.sh') 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 } -- cgit v1.2.3-54-g00ecf