Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 14596 invoked from network); 5 Mar 2004 10:14:50 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Mar 2004 10:14:50 -0000 Received: (qmail 68093 invoked by uid 500); 5 Mar 2004 10:14:21 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 68007 invoked by uid 500); 5 Mar 2004 10:14:21 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 67993 invoked from network); 5 Mar 2004 10:14:21 -0000 Received: from unknown (HELO palrel13.hp.com) (156.153.255.238) by daedalus.apache.org with SMTP; 5 Mar 2004 10:14:21 -0000 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel13.hp.com (Postfix) with ESMTP id AD1BC1C00FD2 for ; Fri, 5 Mar 2004 02:14:34 -0800 (PST) Received: from iseran.com (chamonix.hpl.hp.com [15.144.25.135]) by hplms2.hpl.hp.com (8.12.10/8.12.10/HPL-PA Hub) with ESMTP id i25AEVFU016652 for ; Fri, 5 Mar 2004 02:14:32 -0800 (PST) Message-ID: <4048524F.5010906@iseran.com> Date: Fri, 05 Mar 2004 10:11:27 +0000 From: Steve Loughran User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Developers List Subject: Re: Sshexec fail on starting a service (websphere) References: <200403042230.i24MUV4Z027613@barrierb241.nike.com> In-Reply-To: <200403042230.i24MUV4Z027613@barrierb241.nike.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Anderson, Rob (Global Trade) wrote: > The sshexec task, jsch and ssh cannot be expected to anylize the output from a command that is run. This is why there is an exit status. The example of echo is a good one. Echo will succeed and report exit status 0 to the process that calls it. If you wish to anylize the output of echo, you need to do this in the parent process. While I agree with everything you say, the limited scope of exit codes really irritates me. all we have to return errors and success is a number, a number that can also be used in different ways by java.exe, and which behaves differently on different boxes. This code snippet from the LGPL smartfrog tasks (smartfrog.org) show the problem. I am forking java, but java.exe can return things if it feels like it, so the program we fork knows to return -1 for an error -the switch statement should say 0==good, -1 error, else: trouble. Only java1.4.2 on hpux seems to return 255 instead of -1 on exec. I can see a bit of platform specific details creeping in there, and it makes me unhappy. switch(err) { case 0: return; //-1 is an expected error, but //for some reason smartfrog on HP-UX returns something else. //so we catch 255 as well. case -1: case 255: throw new BuildException(failureText); default: throw new BuildException(errorText+" - error code "+err); } Can we ever move to a world where executed programs throw a full exception up to the caller, rather than just return a status code? --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org