Don't start applications in the background to avoid breaking console

applications.
This commit is contained in:
Francois Gouget 2001-05-10 03:16:37 +00:00 committed by Alexandre Julliard
parent adcc3ad01f
commit ffc9c8a035

View File

@ -367,37 +367,27 @@ clean_up_info_message ()
use_log_name=0 use_log_name=0
log_name=`mktemp /tmp/wine.log.XXXXXX` log_name=`mktemp /tmp/wine.log.XXXXXX`
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
which tail >/dev/null 2>&1 use_log_name=1
if [ $? -eq 0 ]; then fi
use_log_name=1 use_status_name=0
fi status_name=`mktemp /tmp/wine.status.XXXXXX`
if [ $? -eq 0 ] ; then
use_status_name=1
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Okay, really launch Wine... # Okay, really launch Wine...
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if [ $use_log_name -ne 0 ] ; then if [ $use_log_name -ne 0 -a $use_status_name -ne 0 ] ; then
#------------------------------------------------------------------------------ ( $WINEBIN/$WINE_BIN_NAME "$@"; echo $? >$status_name ) 2>&1 | tee $log_name
# Okay, we bend over backwards to run Wine, get that status, wine_return=`cat $status_name`
# but still display its output to the screen.
# The obvious thing to do is to run wine and pipe output to tee,
# but then I can't find a way to get the return code of wine;
# I only get the return code of tee.
#------------------------------------------------------------------------------
$WINEBIN/$WINE_BIN_NAME "$@" >$log_name 2>&1 &
wine_pid=$!
tail -f $log_name &
tail_pid=$!
wait $wine_pid
wine_return=$?
kill $tail_pid
else else
$WINEBIN/$WINE_BIN_NAME "$@" $WINEBIN/$WINE_BIN_NAME "$@"
wine_return=$? wine_return=$?
fi fi
if [ $use_status_name -ne 0 ] ; then
rm -f $status_name
fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Test the return code, and see if it fails # Test the return code, and see if it fails