On 04/26/12 01:12, MacArthur, Ian (SELEX GALILEO, UK) wrote:
>> Also, I got MinGW running. Only caveat: if the script fails, the .BAT
>> still does not fail, hence the result is alway "success". Maybe anyone has
>> an idea?
>
> I see Greg has some suggestions, but I wonder if we can get away
> with something really crude here...
>
> What I'm thinking is that:
>
> [the BAT manipulates a marker file]
Heh, that would definitely be the right idea if DOS can't be
convinced any other way.
But unless there's something unique about the Windows version of sh,
I do think the exit code is getting eaten by the '|| set ERRORLEVEL=1'
at the end being part of the 'sh' cmds.
DOS handles and passes exit codes through it pretty consistently.
In fact, in Windows it's possible for programs to exit(-1)
or exit(10000), which unix tools often don't handle very well,
as they only like 0 - 127 for exit values.
Sometimes this is a reason to actually /have to/ use DOS BAT
to manage these values properly, because many unix shells can't.
For instance:
C:\WINDOWS>perl -e "my $code=system('cmd /c exit 1024') >> 8; print
'EXIT='.$code;"
EXIT=0
Here we simulate an exit return of 1024, and perl's system command
mistakes it for an exit code of 0.
But in Matt's case it's OK, because all the tools he's running
are unix tools (make,date,etc) which all surely return unix-friendly
values.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev