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
diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp
index 86a8fb9..e2d0102 100644
--- a/vm/native/dalvik_system_Zygote.cpp
+++ b/vm/native/dalvik_system_Zygote.cpp
@@ -287,13 +287,15 @@
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;
}
@@ -304,7 +306,8 @@
}
// 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;
}