aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-07-25 14:09:40 -0500
committerandroid-build-merger2017-07-25 14:09:40 -0500
commitac634e3c9dee32b660100788aefdb552cca31261 (patch)
treed8fece6fe60349a1d8cf1753f67cfcaa9ec7da21 /updater
parent276ff4cc33f80054b01961b6684e4790eb2bddf4 (diff)
parentf5396eb8b272d8e94e54fec1f878e955bfc67ea6 (diff)
downloadplatform-bootable-recovery-ac634e3c9dee32b660100788aefdb552cca31261.tar.gz
platform-bootable-recovery-ac634e3c9dee32b660100788aefdb552cca31261.tar.xz
platform-bootable-recovery-ac634e3c9dee32b660100788aefdb552cca31261.zip
Merge "updater: Remove dead make_parents()."
am: f5396eb8b2 Change-Id: Ief0557813324d49c5da64265dc49ab757ed3ae3f
Diffstat (limited to 'updater')
-rw-r--r--updater/install.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/updater/install.cpp b/updater/install.cpp
index bfe91e7f..8e54c2e7 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -95,34 +95,6 @@ void uiPrintf(State* _Nonnull state, const char* _Nonnull format, ...) {
95 uiPrint(state, error_msg); 95 uiPrint(state, error_msg);
96} 96}
97 97
98static bool is_dir(const std::string& dirpath) {
99 struct stat st;
100 return stat(dirpath.c_str(), &st) == 0 && S_ISDIR(st.st_mode);
101}
102
103// Create all parent directories of name, if necessary.
104static bool make_parents(const std::string& name) {
105 size_t prev_end = 0;
106 while (prev_end < name.size()) {
107 size_t next_end = name.find('/', prev_end + 1);
108 if (next_end == std::string::npos) {
109 break;
110 }
111 std::string dir_path = name.substr(0, next_end);
112 if (!is_dir(dir_path)) {
113 int result = mkdir(dir_path.c_str(), 0700);
114 if (result != 0) {
115 PLOG(ERROR) << "failed to mkdir " << dir_path << " when make parents for " << name;
116 return false;
117 }
118
119 LOG(INFO) << "created [" << dir_path << "]";
120 }
121 prev_end = next_end;
122 }
123 return true;
124}
125
126// mount(fs_type, partition_type, location, mount_point) 98// mount(fs_type, partition_type, location, mount_point)
127// mount(fs_type, partition_type, location, mount_point, mount_options) 99// mount(fs_type, partition_type, location, mount_point, mount_options)
128 100