texk/web2c/lib/uexit.c
raw| 1 | /* uexit.c: define uexit to do an exit with the right status. We can't |
| 2 | just call `exit' from the web files, since the webs use `exit' as a |
| 3 | loop label. Public domain. */ |
| 4 | |
| 5 | #include <w2c/config.h> |
| 6 | |
| 7 | void |
| 8 | uexit (int unix_code) |
| 9 | { |
| 10 | int final_code; |
| 11 | |
| 12 | if (unix_code == 0) |
| 13 | final_code = EXIT_SUCCESS; |
| 14 | else if (unix_code == 1) |
| 15 | final_code = EXIT_FAILURE; |
| 16 | else |
| 17 | final_code = unix_code; |
| 18 | |
| 19 | exit (final_code); |
| 20 | } |