diff options
author | William A. Kennington III <wak@google.com> | 2018-10-19 17:18:34 -0700 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2018-10-19 17:26:03 -0700 |
commit | 3e781064f534ae0c822ac4c4f5590635633aa394 (patch) | |
tree | 675226520152cb0f58c1334a42ddfcec3c1d3c22 /control/main.cpp | |
parent | b884821df59d8f477d715f326caf74790647dede (diff) | |
download | phosphor-fan-presence-3e781064f534ae0c822ac4c4f5590635633aa394.tar.gz phosphor-fan-presence-3e781064f534ae0c822ac4c4f5590635633aa394.zip |
Fix exit status codes
Using an exit status of -1 everywhere leads to the status being
converted to 255 when output to a calling application. While this does
signify an error it has a reserved meaning for exit status out of range.
Lets use a valid general exit status of 1 instead.
Change-Id: I326701c78985e34c430c258fe31d9e910da10405
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'control/main.cpp')
-rw-r--r-- | control/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/control/main.cpp b/control/main.cpp index 80a7df6..8c13cf9 100644 --- a/control/main.cpp +++ b/control/main.cpp @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) if (argc != 2) { args.usage(argv); - exit(-1); + return 1; } Mode mode; @@ -48,7 +48,7 @@ int main(int argc, char* argv[]) else { args.usage(argv); - exit(-1); + return 1; } auto r = sd_event_default(&events); @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) { log<level::ERR>("Failed call to sd_event_default()", entry("ERROR=%s", strerror(-r))); - return -1; + return 1; } phosphor::fan::event::EventPtr eventPtr{events}; @@ -86,7 +86,7 @@ int main(int argc, char* argv[]) } } //Log the useful metadata on these exceptions and let the app - //return -1 so it is restarted without a core dump. + //return 1 so it is restarted without a core dump. catch (phosphor::fan::util::DBusServiceError& e) { log<level::ERR>("Uncaught DBus service lookup failure exception", @@ -110,5 +110,5 @@ int main(int argc, char* argv[]) entry("PROPERTY=%s", e.property.c_str())); } - return -1; + return 1; } |