summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-misc.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-12 19:39:30 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-12 19:39:30 +0100
commite4a5db7f3500b3706a479133b8d7b1465a570da5 (patch)
treeac5346fc29701e6a7ba50184bb6f69eff62c7cdc /src/core/libs/lib-misc.sh
parent119bc8fb89b78528a792335460ac200bf14d5804 (diff)
cleaner handling of exit code and running state in run_background + installpkg exit code fix
Diffstat (limited to 'src/core/libs/lib-misc.sh')
-rw-r--r--src/core/libs/lib-misc.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index 06136cb..8236c0b 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -2,7 +2,7 @@
# run a process in the background, and log it's stdout and stderr to a specific logfile
-# You are supposed to clean up the retcode yourself!
+# returncode is stored in $<identifier>_exitcode
# $1 identifier
# $2 command (will be eval'ed)
# $3 logfile
@@ -13,13 +13,13 @@ run_background ()
[ -z "$3" ] && die_error "run_background needs a logfile to redirect output to!"
( \
- touch /tmp/$1-running
+ touch /home/arch/fifa/runtime/$1-running
echo "$1 progress ..." > $3; \
echo >> $3; \
eval "$2" >>$3 2>&1
- echo $? > /tmp/.$1-retcode
+ read $1_exitcode <<< $?
echo >> $3
- rm -f /tmp/$1-running
+ rm -f /home/arch/fifa/runtime/$1-running
) &
sleep 2