update_engine: Move glib related utils to glib_utils.h.
This patch move the remaining glib.h functions used from utils.h to
glib_utils.h.
BUG=chromium:499886
TEST=emerge-link update_engine
Change-Id: Ia727cf3d4ee29fb33fa4db500ca83ea37d23a335
Reviewed-on: https://chromium-review.googlesource.com/281446
Reviewed-by: Alex Vakulenko <[email protected]>
Tested-by: Alex Deymo <[email protected]>
Commit-Queue: Alex Deymo <[email protected]>
Trybot-Ready: Alex Deymo <[email protected]>
diff --git a/utils.cc b/utils.cc
index 03f642a..f36cbec 100644
--- a/utils.cc
+++ b/utils.cc
@@ -40,7 +40,6 @@
#include <chromeos/data_encoding.h>
#include <chromeos/key_value_store.h>
#include <chromeos/message_loops/message_loop.h>
-#include <glib.h>
#include "update_engine/clock_interface.h"
#include "update_engine/constants.h"
@@ -676,7 +675,7 @@
TEST_AND_RETURN_FALSE_ERRNO(errno == EBUSY &&
num_retries < kUnmountMaxNumOfRetries);
- g_usleep(kUnmountRetryIntervalInMicroseconds);
+ usleep(kUnmountRetryIntervalInMicroseconds);
}
return true;
}
@@ -1503,15 +1502,6 @@
return Time::UnixEpoch() + TimeDelta::FromMicroseconds(us);
}
-gchar** StringVectorToGStrv(const vector<string> &vec_str) {
- GPtrArray *p = g_ptr_array_new();
- for (const string& str : vec_str) {
- g_ptr_array_add(p, g_strdup(str.c_str()));
- }
- g_ptr_array_add(p, nullptr);
- return reinterpret_cast<gchar**>(g_ptr_array_free(p, FALSE));
-}
-
string StringVectorToString(const vector<string> &vec_str) {
string str = "[";
for (vector<string>::const_iterator i = vec_str.begin();