diff options
author | Gerry Fan <gfan@google.com> | 2019-07-12 10:24:00 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-07-12 10:24:00 -0700 |
commit | c9aff9869d8cb2efbfa24bf76f431337cd957bd0 (patch) | |
tree | ac8d300a33b993b8eb3a05e6d49fd210d2d4f5e9 /sdcard/sdcard.cpp | |
parent | d2e75075e9611f07242f4814c384cf0b3b83a9a6 (diff) | |
parent | ff7da227dbe0f52d3eb9a3791cd19af99efda302 (diff) | |
download | system_core-c9aff9869d8cb2efbfa24bf76f431337cd957bd0.tar.gz system_core-c9aff9869d8cb2efbfa24bf76f431337cd957bd0.tar.bz2 system_core-c9aff9869d8cb2efbfa24bf76f431337cd957bd0.zip |
Merge "Revert "Revert "rootdir / sdcard : Stop creating /data/media/obb.""" into qt-dev
am: ff7da227db
Change-Id: I42b5fdcdb6b87afe44353d830f6b1b5c0c645fc0
Diffstat (limited to 'sdcard/sdcard.cpp')
-rw-r--r-- | sdcard/sdcard.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sdcard/sdcard.cpp b/sdcard/sdcard.cpp index 2b358197a..0acea7266 100644 --- a/sdcard/sdcard.cpp +++ b/sdcard/sdcard.cpp @@ -214,7 +214,14 @@ static void run_sdcardfs(const std::string& source_path, const std::string& labe if (multi_user) { std::string obb_path = source_path + "/obb"; - fs_prepare_dir(obb_path.c_str(), 0775, uid, gid); + // Only attempt to prepare the /obb dir if it already exists. We want + // the legacy obb path "/data/media/obb" to be fixed up so that we can + // migrate it to its new location, but we don't want the directory to be + // created if it doesn't already exist. + struct stat sb; + if (TEMP_FAILURE_RETRY(lstat(obb_path.c_str(), &sb)) == 0) { + fs_prepare_dir(obb_path.c_str(), 0775, uid, gid); + } } exit(0); |