summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-misc.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-09 13:43:01 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-09 13:43:01 +0100
commit91bf50caf5380135fc82ea2839ebbe94c15e673b (patch)
treef65f20b6dd794df4e23428b79b72e1b590b035b4 /src/core/libs/lib-misc.sh
parent06b8ca8f164fe4add2c02fe51675af1702e23200 (diff)
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
Diffstat (limited to 'src/core/libs/lib-misc.sh')
-rw-r--r--src/core/libs/lib-misc.sh5
1 files changed, 3 insertions, 2 deletions
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 ($<identifier>_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
) &