diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-09 20:36:01 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-09 20:36:01 +0100 |
commit | aca6efd29ead9796880abbaaada3b52101b1778e (patch) | |
tree | d0371ef82adfb083b79ed9dffe98bf0c31f9c2ac | |
parent | a2149a86818d3d7c2fb82e7b3f9ed8785c04542f (diff) |
correctly return wait_for exitcode, and use it to die_error if needed
-rw-r--r-- | src/core/libs/lib-misc.sh | 6 |
1 files changed, 3 insertions, 3 deletions
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 } |