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 /cooling-type/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 'cooling-type/main.cpp')
-rw-r--r-- | cooling-type/main.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cooling-type/main.cpp b/cooling-type/main.cpp index f690f80..3aa7d28 100644 --- a/cooling-type/main.cpp +++ b/cooling-type/main.cpp @@ -12,7 +12,7 @@ using namespace phosphor::logging; int main(int argc, char* argv[]) { - auto rc = -1; + auto rc = 1; auto options = ArgumentParser(argc, argv); auto objpath = (options)["path"]; @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) else { log<level::ERR>("--event=<keycode> argument required\n"); - exit(-1); + return rc; } } @@ -66,7 +66,6 @@ int main(int argc, char* argv[]) } catch (DBusMethodError& dme) { - rc = -1; log<level::ERR>("Uncaught DBus method failure exception", entry("BUSNAME=%s", dme.busName.c_str()), entry("PATH=%s", dme.path.c_str()), @@ -75,7 +74,6 @@ int main(int argc, char* argv[]) } catch (std::exception& err) { - rc = -1; log<phosphor::logging::level::ERR>(err.what()); } |