This is the mail archive of the
mailing list for the Cygwin project.
windows exit codes truncated to 1 Byte
- From: Cristian <cris_mail_ro at yahoo dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Thu, 31 Mar 2016 13:01:22 +0000 (UTC)
- Subject: windows exit codes truncated to 1 Byte
- Authentication-results: sourceware.org; auth=none
- References: <1233154500 dot 205789 dot 1459429282664 dot JavaMail dot yahoo dot ref at mail dot yahoo dot com>
- Reply-to: Cristian <cris_mail_ro at yahoo dot com>
I noted that exit codes returned by CMD and other apps (msiexec) are truncated to 1 byte (0 .. 255).
Steps to reproduce:
1) Create a batch with this content:
$ cat ./test.bat
echo Test exit code 266
exit /B 266
2) run the batch file:
Test exit code 266
3) check exit code
$ echo $?
I would expect 266 but I got 10 instead. I checked for other codes and the result is the same.
Windows exit codes are represented using 32 bits, so is this limitation intentional?
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple