From 91bf50caf5380135fc82ea2839ebbe94c15e673b Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 9 Dec 2010 13:43:01 +0100 Subject: fix correct exitcode variables in run_{controlled,background} commands Since 44bc9f54734d9280c71959e56189044141bc1640, the variablenames for the exit code was still incorrect in the debug logmessage and a doc header Also added a debug line for run_controlled --- src/core/libs/lib-misc.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index d45f8ca..00edcbc 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -1,7 +1,7 @@ #!/bin/bash -# runs a process and makes sure the output is shown to the user. sets the exit state of the executed program ($_exitcode) so the caller can show a concluding message. +# runs a process and makes sure the output is shown to the user. sets the exit state of the executed program ($CONTROLLED_EXIT) so the caller can show a concluding message. # when in dia mode, we will run the program and a dialog instance in the background (cause that's just how it works with dia) # when in cli mode, the program will just run in the foreground. technically it can be run backgrounded but then we need tail -f (cli_follow_progress), and we miss the beginning of the output if it goes too fast, not to mention because of the sleep in run_background # $1 identifier @@ -30,6 +30,7 @@ run_controlled () eval "$2" >>$3 2>&1 CONTROLLED_EXIT=$? fi + debug 'MISC' "run_controlled done with $1: exitcode (\$CONTROLLED_EXIT): $CONTROLLED_EXIT .Logfile $3" } @@ -58,7 +59,7 @@ run_background () echo "STARTING $1 . Executing $2 >>$3 2>&1\n" >> $3; eval "$2" >>$3 2>&1 BACKGROUND_EXIT=$? - debug 'MISC' "run_background done with $1: exitcode (\$$1_exitcode): ${!var_exit} .Logfile $3" + debug 'MISC' "run_background done with $1: exitcode (\$BACKGROUND_EXIT): $BACKGROUND_EXIT .Logfile $3" echo >> $3 rm -f $RUNTIME_DIR/aif-$1-running ) & -- cgit v1.2.3-54-g00ecf