vold: Don't freak out if an asec mountpoint already exists
Signed-off-by: San Mehat <san@google.com>
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 830c634..4a41923 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -220,10 +220,12 @@
snprintf(mountPoint, sizeof(mountPoint), "/asec/%s", id);
if (mkdir(mountPoint, 0777)) {
- LOGE("Mountpoint creation failed (%s)", strerror(errno));
- Loop::destroyByDevice(loopDevice);
- unlink(asecFileName);
- return -1;
+ if (errno != EEXIST) {
+ LOGE("Mountpoint creation failed (%s)", strerror(errno));
+ Loop::destroyByDevice(loopDevice);
+ unlink(asecFileName);
+ return -1;
+ }
}
if (Fat::doMount(loopDevice, mountPoint, false, false, ownerUid,