On Tue, 28 Nov 2000, Michael Tulinius Andersen wrote:
> Hi,
>
> thank you for Jacl it is nice work.
>
> However I have made a little correction to make the exec command set the
> errorCode as it should:
>
> diff ExecCmd.java ExecCmd.java.org
> 157,160d156
> < if (exit != 0) {
> < interp.setErrorCode(TclInteger.newInstance(exit));
> < }
> <
>
> Hope you can use it.
>
> Best regards
>
> Michael Tulinius Andersen
> @Softility.dk
Humm, me thinks that is still not quite right.
Here are the results I am seeing with your patch.
$ tclsh8.3
% exec false
child process exited abnormally
% set errorCode
CHILDSTATUS 28026 1
$ jaclsh
% exec false
child process exited abnormally
% set errorCode
1
Was this the patch you were going for? This
is from the CVS version.
diff -u -r1.5 ExecCmd.java
--- ExecCmd.java 1999/05/17 03:50:37 1.5
+++ ExecCmd.java 2000/11/30 10:19:14
@@ -154,6 +154,9 @@
//when the subprocess writes to its stderr stream or returns
//a non zero result we generate an error
+ if (exit != 0) {
+ interp.setErrorCode(TclInteger.newInstance(exit));
+ }
if ((exit != 0) || (errorBytes != 0)) {
throw new TclException(interp, sbuf.toString());
}
I can touch it up and add a test case if this
patch looks like what you wanted to do.
Mo DeJong
Red Hat Inc
|