AU: Ensure update_engine_client get proxy retries are spaced out in time.
Hopefully, this will reduce test flakyness. It seems that last time the test
failed all 4 tries happened within a one-second timeframe.
Also, fix GError object memory leaks throughout the code.
BUG=chromium-os:21351
TEST=unit tests, tested on VM
Change-Id: If0bc5d5767d12f3396d0fcb46f3e04ed6d7dfd5c
Reviewed-on: http://gerrit.chromium.org/gerrit/8862
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/subprocess.cc b/subprocess.cc
index a638145..f0647e2 100644
--- a/subprocess.cc
+++ b/subprocess.cc
@@ -3,14 +3,19 @@
// found in the LICENSE file.
#include "update_engine/subprocess.h"
+
#include <stdlib.h>
#include <string.h>
-#include <string>
#include <unistd.h>
+
+#include <string>
#include <vector>
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/string_util.h"
+
+#include <base/logging.h>
+#include <base/memory/scoped_ptr.h>
+#include <base/string_util.h>
+
+#include "update_engine/utils.h"
using std::string;
using std::tr1::shared_ptr;
@@ -220,10 +225,7 @@
return_code,
&err);
FreeArgv(argv.get());
- if (err) {
- LOG(INFO) << "err is: " << err->code << ", " << err->message;
- g_error_free(err);
- }
+ LOG_IF(INFO, err) << utils::GetAndFreeGError(&err);
if (child_stdout) {
if (stdout) {
*stdout = child_stdout;