This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

windows exit codes truncated to 1 Byte


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 off 
rem ==================== 
echo Test exit code 266 
exit /B 266 
rem ==================== 

2) run the batch file:
$ ./test.bat 
Test exit code 266 

3) check exit code
$ echo $? 
10 


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?


Best regards,
Cristi

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]