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

Side by Side Diff: utils.h

Issue 6719012: Use crossystem rather than cros_boot_mode. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « setup_dev_packages ('k') | utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_UTILS_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_UTILS_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_UTILS_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_UTILS_H__
7 7
8 #include <errno.h> 8 #include <errno.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 11 matching lines...) Expand all
22 22
23 namespace utils { 23 namespace utils {
24 24
25 // Returns true if this is an official Chrome OS build, false otherwise. 25 // Returns true if this is an official Chrome OS build, false otherwise.
26 bool IsOfficialBuild(); 26 bool IsOfficialBuild();
27 27
28 // Returns true if the OOBE process has been completed and EULA accepted, false 28 // Returns true if the OOBE process has been completed and EULA accepted, false
29 // otherwise. 29 // otherwise.
30 bool IsOOBEComplete(); 30 bool IsOOBEComplete();
31 31
32 // Returns true if the boot mode is normal, false otherwise (e.g., developer or 32 // Returns true if the boot mode is normal or if it's unable to determine the
33 // recovery). 33 // boot mode. Returns false if the boot mode is developer.
34 bool IsNormalBootMode(); 34 bool IsNormalBootMode();
35 35
36 // Writes the data passed to path. The file at path will be overwritten if it 36 // Writes the data passed to path. The file at path will be overwritten if it
37 // exists. Returns true on success, false otherwise. 37 // exists. Returns true on success, false otherwise.
38 bool WriteFile(const char* path, const char* data, int data_len); 38 bool WriteFile(const char* path, const char* data, int data_len);
39 39
40 // Calls write() or pwrite() repeatedly until all count bytes at buf are 40 // Calls write() or pwrite() repeatedly until all count bytes at buf are
41 // written to fd or an error occurs. Returns true on success. 41 // written to fd or an error occurs. Returns true on success.
42 bool WriteAll(int fd, const void* buf, size_t count); 42 bool WriteAll(int fd, const void* buf, size_t count);
43 bool PWriteAll(int fd, const void* buf, size_t count, off_t offset); 43 bool PWriteAll(int fd, const void* buf, size_t count, off_t offset);
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (_error) { \ 423 if (_error) { \
424 errno = _error; \ 424 errno = _error; \
425 LOG(ERROR) << #_x " failed: " << _error; \ 425 LOG(ERROR) << #_x " failed: " << _error; \
426 return false; \ 426 return false; \
427 } \ 427 } \
428 } while (0) 428 } while (0)
429 429
430 430
431 431
432 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UTILS_H__ 432 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UTILS_H__
OLDNEW
« no previous file with comments | « setup_dev_packages ('k') | utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698