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:
Yves Arrouye 2000-08-10 00:09:17 +00:00
parent 118e812785
commit 91d5a8163e

View file

@ -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;