update_engine_client: Fixes some styling/lint issues
Fixed some styling/lint issues introduced in CL:556356
BUG=none
TEST=cros_workon_make --board=amd64-generic --test update_engine
Change-Id: I80525d4fba5a7fea5be533ccaa0026bd381d4175
Reviewed-on: https://chromium-review.googlesource.com/592071
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/update_engine_client.cc b/update_engine_client.cc
index f337dd6..ad6ded0 100644
--- a/update_engine_client.cc
+++ b/update_engine_client.cc
@@ -14,13 +14,6 @@
// limitations under the License.
//
-#include <base/bind.h>
-#include <base/command_line.h>
-#include <base/logging.h>
-#include <base/macros.h>
-#include <brillo/daemons/daemon.h>
-#include <brillo/flag_helper.h>
-
#include <inttypes.h>
#include <sysexits.h>
#include <unistd.h>
@@ -29,6 +22,14 @@
#include <string>
#include <vector>
+#include <base/bind.h>
+#include <base/command_line.h>
+#include <base/logging.h>
+#include <base/macros.h>
+#include <base/threading/platform_thread.h>
+#include <brillo/daemons/daemon.h>
+#include <brillo/flag_helper.h>
+
#include "update_engine/client.h"
#include "update_engine/common/error_code.h"
#include "update_engine/common/error_code_utils.h"
@@ -55,7 +56,7 @@
// The ShowStatus request will be retried `kShowStatusRetryCount` times at
// `kShowStatusRetryInterval` second intervals on failure.
const int kShowStatusRetryCount = 30;
-const int kShowStatusRetryInterval = 2;
+const int kShowStatusRetryIntervalInSeconds = 2;
class UpdateEngineClient : public brillo::Daemon {
public:
@@ -165,8 +166,9 @@
if (--retry_count == 0) {
return false;
}
- LOG(WARNING) << "Trying " << retry_count << " more times";
- sleep(kShowStatusRetryInterval);
+ LOG(WARNING) << "Will try " << retry_count << " more times!";
+ base::PlatformThread::Sleep(
+ base::TimeDelta::FromSeconds(kShowStatusRetryIntervalInSeconds));
}
printf("LAST_CHECKED_TIME=%" PRIi64