summaryrefslogtreecommitdiffstats
path: root/sdcard/sdcard.cpp
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2019-05-17 12:20:54 +0100
committerAnton Hansson <hansson@google.com>2019-05-23 15:09:54 +0100
commitc6ca823710d49754c3717e9cf3ba11b9c2648825 (patch)
treee197f10766aad81ac2041593c6da94248cacfc20 /sdcard/sdcard.cpp
parentb36b54cf796d722653ad9bea11284815a3f5eda5 (diff)
downloadsystem_core-c6ca823710d49754c3717e9cf3ba11b9c2648825.tar.gz
system_core-c6ca823710d49754c3717e9cf3ba11b9c2648825.tar.bz2
system_core-c6ca823710d49754c3717e9cf3ba11b9c2648825.zip
rootdir / sdcard : Stop creating /data/media/obb.
This directory is no longer used. OBB content is placed in /data/media/$user/Android. Test: make Test: manually verify the path doesn't exist. Bug: 129167772 Change-Id: I8549826586b9a68c8cfa3fe2e51295363f9b4e11
Diffstat (limited to 'sdcard/sdcard.cpp')
-rw-r--r--sdcard/sdcard.cpp9
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);