From e73206f68184a0d571a875044cf0a2cb6090f454 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 3 Sep 2015 11:38:00 -0400 Subject: [PATCH] Only return 0..255 from main(). I think this may fix some bugs with windows exit codes being screwy. --- changes/normalize_exit | 3 +++ src/or/tor_main.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changes/normalize_exit 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; } -- 2.11.4.GIT