Skip to content

Commit

Permalink
buildtools/BaseTools/Source/Python/build/build.py:
Browse files Browse the repository at this point in the history
  Be sure that exit code is between 0 and 127 inclusive.  If not,
  return 127 instead.  As mentioned in the python documentation for
  sys.exit, the return should be in the range 0-127, or else there
  may be undefined results.
  (http://docs.python.org/lib/module-sys.html)

  For the return code of 0x4000 (16384), it was found that several
  unix-like system would end up mapping this return to 0, which was
  then interpreted as a successful return.


git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1273 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jljusten committed Jul 2, 2008
1 parent 7533661 commit 2d81b76
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/Python/build/build.py
Expand Up @@ -1322,4 +1322,6 @@ def Main():
return ReturnCode

if __name__ == '__main__':
sys.exit(Main())
r = Main()
if r < 0 or r > 127: r = 127
sys.exit(r)

0 comments on commit 2d81b76

Please sign in to comment.