diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-09-03 11:38:00 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-09-03 11:38:00 -0400 |
commit | e73206f68184a0d571a875044cf0a2cb6090f454 (patch) | |
tree | e3806f84c186aa65f0b2c92dc43f1e542d3e145f | |
parent | 91ca434451064ef00532c4f8e4b098f2b1c516d1 (diff) | |
download | tor-e73206f68184a0d571a875044cf0a2cb6090f454.tar.gz tor-e73206f68184a0d571a875044cf0a2cb6090f454.zip |
Only return 0..255 from main().
I think this may fix some bugs with windows exit codes being screwy.
-rw-r--r-- | changes/normalize_exit | 3 | ||||
-rw-r--r-- | src/or/tor_main.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/changes/normalize_exit b/changes/normalize_exit new file mode 100644 index 0000000000..636d45a45a --- /dev/null +++ b/changes/normalize_exit @@ -0,0 +1,3 @@ + o Minor features: + - Try harder to normalize the exit status of the Tor process to the + standard-provided range. diff --git a/src/or/tor_main.c b/src/or/tor_main.c index af03b8c06a..65bb020c2c 100644 --- a/src/or/tor_main.c +++ b/src/or/tor_main.c @@ -27,6 +27,10 @@ int tor_main(int argc, char *argv[]); int main(int argc, char *argv[]) { - return tor_main(argc, argv); + int r = tor_main(argc, argv); + if (r < 0 || r > 255) + return 1; + else + return r; } |