mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-360 fix the return of the the system exit code so that the
!@()$#&!)@$ make will stop. Here's the short story: on Unix system returns the status code in the *upper 8 bits* of a 16 bit value, plus some magic values. If you don't shift the return value right 8 bits, and return that, then the calling process won't see the error, because it will only see the low 8 bits (which don't make sense, the data being in the upper 8 bits). This is a common mistake people do when using system. Don't ask how long it took me to notice that pkgdata failed to stop the makefiles, I'm too upset right now... X-SVN-Rev: 2156
This commit is contained in:
parent
118e812785
commit
91d5a8163e
1 changed files with 1 additions and 1 deletions
|
@ -341,7 +341,7 @@ main(int argc, const char *argv[]) {
|
|||
if(rc < 0) {
|
||||
fprintf(stderr, "# Failed, rc=%d\n", rc);
|
||||
}
|
||||
return rc;
|
||||
return rc < 128 ? rc : (rc >> 8);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue