summaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorKoji Fukui <koji.fukui@sonymobile.com>2013-11-26 12:22:55 +0900
committerSteve Kondik <shade@chemlab.org>2013-12-21 01:58:23 -0800
commit3e4bd2d6153f0b72ad7813d3c07c237f9647f788 (patch)
tree874a299684da7cca56e35fa65154f54da009b047 /vm
parent177fb5ad85309640e7ce1336207aea2faa47612f (diff)
downloadandroid_dalvik-3e4bd2d6153f0b72ad7813d3c07c237f9647f788.tar.gz
android_dalvik-3e4bd2d6153f0b72ad7813d3c07c237f9647f788.tar.bz2
android_dalvik-3e4bd2d6153f0b72ad7813d3c07c237f9647f788.zip
Retry mount() if it fails with EINTR
mount() may fail EINTR, and when it does this causes dalvik to crash. Use the regular retry macro to avoid these problems. Change-Id: I436fe4f0fab36c8172b43b8b9caedcb6d8167a4f
Diffstat (limited to 'vm')
-rw-r--r--vm/native/dalvik_system_Zygote.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp
index f0d8cf637..1848bdda8 100644
--- a/vm/native/dalvik_system_Zygote.cpp
+++ b/vm/native/dalvik_system_Zygote.cpp
@@ -290,13 +290,15 @@ static int mountEmulatedStorage(uid_t uid, u4 mountMode) {
if (mountMode == MOUNT_EXTERNAL_MULTIUSER_ALL) {
// Mount entire external storage tree for all users
- if (mount(source, target, NULL, MS_BIND, NULL) == -1) {
+ if (TEMP_FAILURE_RETRY(
+ mount(source, target, NULL, MS_BIND, NULL)) == -1) {
ALOGE("Failed to mount %s to %s: %s", source, target, strerror(errno));
return -1;
}
} else {
// Only mount user-specific external storage
- if (mount(source_user, target_user, NULL, MS_BIND, NULL) == -1) {
+ if (TEMP_FAILURE_RETRY(
+ mount(source_user, target_user, NULL, MS_BIND, NULL)) == -1) {
ALOGE("Failed to mount %s to %s: %s", source_user, target_user, strerror(errno));
return -1;
}
@@ -307,7 +309,8 @@ static int mountEmulatedStorage(uid_t uid, u4 mountMode) {
}
// Finally, mount user-specific path into place for legacy users
- if (mount(target_user, legacy, NULL, MS_BIND | MS_REC, NULL) == -1) {
+ if (TEMP_FAILURE_RETRY(
+ mount(target_user, legacy, NULL, MS_BIND | MS_REC, NULL)) == -1) {
ALOGE("Failed to mount %s to %s: %s", target_user, legacy, strerror(errno));
return -1;
}