From aca6efd29ead9796880abbaaada3b52101b1778e Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 9 Dec 2010 20:36:01 +0100 Subject: correctly return wait_for exitcode, and use it to die_error if needed --- src/core/libs/lib-misc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index d0548fe..3af5977 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -23,7 +23,7 @@ run_controlled () then run_background $1 "$2" $3 follow_progress " $4 " $3 $BACKGROUND_PID # dia mode ignores the pid. cli uses it to know how long it must do tail -f - wait_for $1 $FOLLOW_PID + wait_for $1 $FOLLOW_PID || die_error "Internal AIF error, the following call failed: wait_for $1 $FOLLOW_PID. This should never happen" CONTROLLED_EXIT=$BACKGROUND_EXIT else notify "$4" @@ -71,7 +71,7 @@ run_background () } -# wait until a process is done +# wait until a process - spawned by run_background - 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. # returns 0 unless anything failed in the wait_for logic (not tied to the exitcode of the program we actually wait for) @@ -89,7 +89,7 @@ wait_for () then kill $2 || ret=1 fi - ret $ret + return $ret } -- cgit v1.2.3-54-g00ecf