This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: don't use `system'
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: don't use `system'
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 18 May 2000 11:17:16 -0600
- Reply-To: tromey at cygnus dot com
This changes the libgcj test suite so it doesn't use `system'. (We
still use it in the Mauve wrapper, but I'm not as concerned about
that.)
2000-05-18 Tom Tromey <tromey@cygnus.com>
* lib/libjava.exp (bytecompile_file): Use exec, not system.
Tom
Index: lib/libjava.exp
===================================================================
RCS file: /cvs/java/libgcj/libjava/testsuite/lib/libjava.exp,v
retrieving revision 1.16
diff -u -r1.16 libjava.exp
--- libjava.exp 2000/05/17 15:48:44 1.16
+++ libjava.exp 2000/05/18 17:14:05
@@ -49,7 +49,7 @@
proc bytecompile_file { file objdir {classpath {}} } {
global env
global SUN_JAVAC
- set dirname [file dirname $file];
+ set dirname [file dirname $file]
# If JDK doesn't run on your platform but some other
# JDK-compatible javac does, you may set SUN_JAVAC to point to it.
@@ -72,7 +72,12 @@
set env(CLASSPATH) $classpath
}
if {[catch {
- system "cd $dirname; $SUN_JAVAC $file -d $objdir 2>&1"
+ set here [pwd]
+ cd $dirname
+ set q [eval exec "$SUN_JAVAC [list $file] -d $objdir 2>@ stdout"]
+ cd $here
+ # "return" a result
+ set q $q
} msg]} then {
verbose "couldn't compile $file: $msg"
set r 0