Index: src/platform/update_engine/update_engine_client.cc |
diff --git a/src/platform/update_engine/update_engine_client.cc b/src/platform/update_engine/update_engine_client.cc |
index 1e273ed036bcfe28104cc9636c627c4885974429..bed72056f073283c57caea08210f6cc7e5a75b2a 100644 |
--- a/src/platform/update_engine/update_engine_client.cc |
+++ b/src/platform/update_engine/update_engine_client.cc |
@@ -16,6 +16,7 @@ extern "C" { |
using chromeos_update_engine::kUpdateEngineServiceName; |
using chromeos_update_engine::kUpdateEngineServicePath; |
using chromeos_update_engine::kUpdateEngineServiceInterface; |
+using chromeos_update_engine::utils::GetGErrorMessage; |
DEFINE_bool(status, false, "Print the status to stdout."); |
DEFINE_bool(force_update, false, |
@@ -25,12 +26,6 @@ DEFINE_bool(check_for_update, false, |
namespace { |
-const char* GetErrorMessage(const GError* error) { |
- if (!error) |
- return "Unknown error."; |
- return error->message; |
-} |
- |
bool GetStatus() { |
DBusGConnection *bus; |
DBusGProxy *proxy; |
@@ -46,7 +41,7 @@ bool GetStatus() { |
kUpdateEngineServiceInterface, |
&error); |
if (!proxy) { |
- LOG(FATAL) << "Error getting proxy: " << GetErrorMessage(error); |
+ LOG(FATAL) << "Error getting proxy: " << GetGErrorMessage(error); |
} |
gint64 last_checked_time = 0; |
@@ -64,7 +59,7 @@ bool GetStatus() { |
&new_size, |
&error); |
if (rc == FALSE) { |
- LOG(INFO) << "Error getting status: " << GetErrorMessage(error); |
+ LOG(INFO) << "Error getting status: " << GetGErrorMessage(error); |
} |
printf("LAST_CHECKED_TIME=%" PRIi64 "\nPROGRESS=%f\nCURRENT_OP=%s\n" |
"NEW_VERSION=%s\nNEW_SIZE=%" PRIi64 "\n", |