Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Mon, 3 Jun 2002 23:11:11 -0400
From: Christopher Faylor <cgf-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: ExitProcess() with negative argument -> zero exit status from wait*()
Message-ID: <20020604031111.GA6857@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20020604030151.19288.qmail@boris.curl.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20020604030151.19288.qmail@boris.curl.com>
User-Agent: Mutt/1.3.23.1i

On Mon, Jun 03, 2002 at 11:01:51PM -0400, Bob Byrnes wrote:
>If a process exits by calling ExitProcess() with a negative argument,
>then cygwin returns a zero exit status to the calling process.  This
>seems wrong, and is different from the behavior of GetExitCodeProcess().

Don't mix the Windows API with the UNIX api.  You're asking for trouble.

If you have to exit, use exit() or _exit().

Either that, or go all of the way and don't use wait().  Start your process
with CreateProcess and use WaitForSingleObject to wait for it.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

