update_engine: Fix update check error crash
In commit 6bb001ff0c2a6b0f26e50354e6a53cd37eb780d4, the return value of
AttemptUpdateWithFlags() became dependent on the out_result of AttemptUpdate()
which is wrong. This dependency causes the error pointer not be populated when
the update check is failed/ignored. And historically, failure of the update
check does not mean the failure of the dbus signal.
BUG=chromium:848486
TEST=cros flash followed by an interactive update did not crash the update engine.
Change-Id: I440c51683bdfc9d671c38142c965466815c69f47
Reviewed-on: https://chromium-review.googlesource.com/1082979
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/dbus_service.cc b/dbus_service.cc
index bb4ff33..c7bc9f0 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -50,14 +50,11 @@
bool interactive = !(flags & update_engine::kAttemptUpdateFlagNonInteractive);
bool result;
return common_->AttemptUpdate(
- error,
- in_app_version,
- in_omaha_url,
- interactive
- ? 0
- : update_engine::UpdateAttemptFlags::kFlagNonInteractive,
- &result) &&
- result;
+ error,
+ in_app_version,
+ in_omaha_url,
+ interactive ? 0 : update_engine::UpdateAttemptFlags::kFlagNonInteractive,
+ &result);
}
bool DBusUpdateEngineService::AttemptRollback(ErrorPtr* error,