summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-07-25 21:23:41 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-07-25 21:23:41 +0200
commit65b9539f790fd41f4d8a8805cd898ce4d9308826 (patch)
treebf48768bced8caba21e9df73a36ac79165f5463e
parentMerge "recovery: Fix the flickering when turning on text mode." am: 771dfb0016 am: 276ff4cc33 am: a40c15717d am: df9252faf7 (diff)
parentMerge "updater: Remove dead make_parents()." am: f5396eb8b2 am: ac634e3c9d am: 28cf022931 (diff)
downloadandroid_bootable_recovery-65b9539f790fd41f4d8a8805cd898ce4d9308826.tar
android_bootable_recovery-65b9539f790fd41f4d8a8805cd898ce4d9308826.tar.gz
android_bootable_recovery-65b9539f790fd41f4d8a8805cd898ce4d9308826.tar.bz2
android_bootable_recovery-65b9539f790fd41f4d8a8805cd898ce4d9308826.tar.lz
android_bootable_recovery-65b9539f790fd41f4d8a8805cd898ce4d9308826.tar.xz
android_bootable_recovery-65b9539f790fd41f4d8a8805cd898ce4d9308826.tar.zst
android_bootable_recovery-65b9539f790fd41f4d8a8805cd898ce4d9308826.zip
-rw-r--r--updater/install.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/updater/install.cpp b/updater/install.cpp
index bfe91e7f9..8e54c2e75 100644
--- a/updater/install.cpp
+++ b/updater/install.cpp
@@ -95,34 +95,6 @@ void uiPrintf(State* _Nonnull state, const char* _Nonnull format, ...) {
uiPrint(state, error_msg);
}
-static bool is_dir(const std::string& dirpath) {
- struct stat st;
- return stat(dirpath.c_str(), &st) == 0 && S_ISDIR(st.st_mode);
-}
-
-// Create all parent directories of name, if necessary.
-static bool make_parents(const std::string& name) {
- size_t prev_end = 0;
- while (prev_end < name.size()) {
- size_t next_end = name.find('/', prev_end + 1);
- if (next_end == std::string::npos) {
- break;
- }
- std::string dir_path = name.substr(0, next_end);
- if (!is_dir(dir_path)) {
- int result = mkdir(dir_path.c_str(), 0700);
- if (result != 0) {
- PLOG(ERROR) << "failed to mkdir " << dir_path << " when make parents for " << name;
- return false;
- }
-
- LOG(INFO) << "created [" << dir_path << "]";
- }
- prev_end = next_end;
- }
- return true;
-}
-
// mount(fs_type, partition_type, location, mount_point)
// mount(fs_type, partition_type, location, mount_point, mount_options)