Index: tools/battor_agent/battor_agent_bin.cc |
diff --git a/tools/battor_agent/battor_agent_bin.cc b/tools/battor_agent/battor_agent_bin.cc |
index 5843ae906b10f6e3f97aaf7075808cda945e38ef..26c855c6e870107755917d4f2e70524799f53ce0 100644 |
--- a/tools/battor_agent/battor_agent_bin.cc |
+++ b/tools/battor_agent/battor_agent_bin.cc |
@@ -49,7 +49,7 @@ |
std::string GetArg(int argnum, int argc, char* argv[]) { |
if (argnum >= argc) { |
PrintUsage(); |
- exit(1); |
+ PLOG(FATAL); |
} |
return argv[argnum]; |
@@ -58,13 +58,16 @@ |
// Checks if an error occurred and, if it did, prints the error and exits |
// with an error code. |
void CheckError(battor::BattOrError error) { |
- if (error != battor::BATTOR_ERROR_NONE) |
- LOG(FATAL) << "Fatal error when communicating with the BattOr: " << error; |
+ if (error != battor::BATTOR_ERROR_NONE) { |
+ LOG(ERROR) << "Fatal error when communicating with the BattOr: " << error; |
+ PLOG(FATAL); |
+ } |
} |
// Prints an error message and exits due to a required thread failing to start. |
void ExitFromThreadStartFailure(const std::string& thread_name) { |
- LOG(FATAL) << "Failed to start " << thread_name; |
+ LOG(ERROR) << "Failed to start " << thread_name; |
+ PLOG(FATAL); |
} |
} // namespace |
@@ -81,7 +84,9 @@ |
file_thread_(kFileThreadName), |
ui_thread_(kUiThreadName) {} |
- ~BattOrAgentBin() { DCHECK(!agent_); } |
+ ~BattOrAgentBin() { |
+ DCHECK(!agent_); |
+ } |
// Runs the BattOr binary and returns the exit code. |
int Run(int argc, char* argv[]) { |