This is the mail archive of the
mailing list for the Cygwin project.
some Win32 exit codes become 0
- From: "Ted Romer" <Ted dot Romer at performant dot com>
- To: <cygwin at cygwin dot com>
- Date: Tue, 25 Jun 2002 15:39:53 -0700
- Subject: some Win32 exit codes become 0
In cygwin-1.3.11-3, if I invoke a Win32 process that exits with negative status (or status >= 256), cygwin converts the status to 0.
Good practice or not, programs often use -1 as an exit status indicating failure, so this makes error checking challenging.
Easy to reproduce:
% perl -e 'exit(-1)'
% echo $?
% jython nosuchscript.py
% echo $?
The cause is that sigproc.cc:stopped_or_terminated assumes that the EXIT_SIGNAL bit in the exit code in fact indicates that the process exited due to a signal. This is true for cygwin processes, but not for Win32 processes.
There is no nice fix that I can think of, since there isn't a clean mapping from Win32 exit codes to cygwin exit codes. I'd be happy with any solution that mapped non-zero Win32 exit codes to non-zero cygwin exit codes.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html