Bug 477724 avoid pointless shell interpreter hanging around r=bsmedberg
--- a/build/unix/mozilla.in
+++ b/build/unix/mozilla.in
@@ -131,13 +131,10 @@ do
;;
esac
done
if [ $debugging = 1 ]
then
echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
fi
-"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
-exitcode=$?
-
-exit $exitcode
+exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
# EOF.
--- a/build/unix/run-mozilla.sh
+++ b/build/unix/run-mozilla.sh
@@ -37,17 +37,17 @@
# ***** END LICENSE BLOCK *****
cmdname=`basename "$0"`
MOZ_DIST_BIN=`dirname "$0"`
MOZ_DEFAULT_NAME="./${cmdname}-bin"
MOZ_APPRUNNER_NAME="./mozilla-bin"
MOZ_VIEWER_NAME="./viewer"
MOZ_PROGRAM=""
-exitcode=0
+exitcode=1
#
##
## Functions
##
##########################################################################
moz_usage()
{
echo "Usage: ${cmdname} [options] [program]"
@@ -135,17 +135,17 @@ moz_run_program()
##
if [ ! -x "$prog" ]
then
moz_bail "Cannot execute $prog."
fi
##
## Run the program
##
- "$prog" ${1+"$@"}
+ exec "$prog" ${1+"$@"}
exitcode=$?
}
##########################################################################
moz_debug_program()
{
prog=$MOZ_PROGRAM
##
## Make sure the program is executable
@@ -163,43 +163,34 @@ moz_debug_program()
else
debugger=`LC_MESSAGES=C type $moz_debugger | awk '{print $3;}' | sed -e 's/\.$//'`
fi
else
debugger=`moz_get_debugger`
fi
if [ -x "$debugger" ]
then
- tmpfile=`mktemp /tmp/mozargs.XXXXXX` || { echo "Cannot create temporary file" >&2; exit 1; }
- trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
- # echo -n isn't portable, so pipe through perl -pe chomp instead
- echo "set args" | perl -pe 'chomp' > $tmpfile
- for PARAM in "$@"
- do
- echo " '$PARAM'" | perl -pe 'chomp' >> $tmpfile
- done
- echo >> $tmpfile
# If you are not using ddd, gdb and know of a way to convey the arguments
# over to the prog then add that here- Gagan Saksena 03/15/00
case `basename $debugger` in
- gdb) echo "$debugger $prog -x $tmpfile"
- $debugger "$prog" -x $tmpfile
+ gdb) echo "$debugger --args $prog" ${1+"$@"}
+ exec "$debugger" --args "$prog" ${1+"$@"}
exitcode=$?
;;
- ddd) echo "$debugger --debugger \"gdb -x $tmpfile\" $prog"
- $debugger --debugger "gdb -x $tmpfile" "$prog"
+ ddd) echo "$debugger --gdb -- --args $prog" ${1+"$@"}
+ exec "$debugger" --gdb -- --args "$prog" ${1+"$@"}
exitcode=$?
;;
*) echo "$debugger $prog ${1+"$@"}"
- $debugger "$prog" ${1+"$@"}
+ exec $debugger "$prog" ${1+"$@"}
exitcode=$?
;;
esac
else
- echo "Could not find a debugger on your system."
+ moz_bail "Could not find a debugger on your system."
fi
}
##########################################################################
##
## Command line arg defaults
##
moz_debug=0
moz_debugger=""