Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: utils.cc

Issue 6098008: AU: Include a bit flag (bit 31) in error codes to indicate non-normal boot mode. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils.h ('k') | utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.cc
diff --git a/utils.cc b/utils.cc
index 359b6b8866a6fee79b5f242f91d4ea4720ce2d17..7b3c049d65ee4c0cb8c4f5028052b65dc3dee3a3 100644
--- a/utils.cc
+++ b/utils.cc
@@ -24,6 +24,7 @@
#include <base/rand_util.h>
#include <base/string_util.h>
#include <base/logging.h>
+#include <cros_boot_mode/boot_mode.h>
#include <rootdev/rootdev.h>
#include "update_engine/file_writer.h"
@@ -49,6 +50,14 @@ bool IsOOBEComplete() {
return file_util::PathExists(FilePath(kOOBECompletedMarker));
}
+bool IsNormalBootMode() {
+ cros_boot_mode::BootMode mode;
+ mode.Initialize(false, true);
adlr 2011/01/07 22:44:08 perhaps a comment about what false, true means?
petkov 2011/01/07 22:50:45 Done.
+ bool normal = mode.mode() == cros_boot_mode::BootMode::kNormal;
+ LOG_IF(INFO, !normal) << "Boot mode not normal: " << mode.mode_text();
+ return normal;
+}
+
bool WriteFile(const char* path, const char* data, int data_len) {
DirectFileWriter writer;
TEST_AND_RETURN_FALSE_ERRNO(0 == writer.Open(path,
« no previous file with comments | « utils.h ('k') | utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698