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 /monitor/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 'monitor/main.cpp')
-rw-r--r-- | monitor/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/monitor/main.cpp b/monitor/main.cpp index 84dd7d1..512e3f7 100644 --- a/monitor/main.cpp +++ b/monitor/main.cpp @@ -35,7 +35,7 @@ int main(int argc, char* argv[]) if (argc != 2) { args.usage(argv); - exit(-1); + return 1; } Mode mode; @@ -50,7 +50,7 @@ int main(int argc, char* argv[]) else { args.usage(argv); - exit(-1); + return 1; } auto r = sd_event_default(&events); @@ -58,7 +58,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; } std::unique_ptr<phosphor::fan::trust::Manager> trust = @@ -101,5 +101,5 @@ int main(int argc, char* argv[]) } } - return -1; + return 1; } |