summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-02-15 23:46:14 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-02-15 23:46:14 +0000
commit456483d19379391b05be2363cc740ee2d93b10e3 (patch)
tree2cc05c79d49cac9d893edb120e4875a4172ae615
parent35829f396827137ccfd549b4f935a0b4867a4ceb (diff)
parent9aec7a2fb6f368922dc9b332ca11fc9d58fcc956 (diff)
downloadvold-o-mr1-iot-preview-7.tar.gz
Merge "mFusePid should be cleared after waitpid successfully"android-p-preview-1android-o-mr1-iot-preview-7o-mr1-iot-preview-7
-rw-r--r--EmulatedVolume.cpp3
-rw-r--r--PublicVolume.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/EmulatedVolume.cpp b/EmulatedVolume.cpp
index 21b290a9..71eaa3ea 100644
--- a/EmulatedVolume.cpp
+++ b/EmulatedVolume.cpp
@@ -105,7 +105,8 @@ status_t EmulatedVolume::doMount() {
usleep(50000); // 50ms
}
/* sdcardfs will have exited already. FUSE will still be running */
- TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG));
+ if (TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG)) == mFusePid)
+ mFusePid = 0;
return OK;
}
diff --git a/PublicVolume.cpp b/PublicVolume.cpp
index f976c4a8..4643a3ac 100644
--- a/PublicVolume.cpp
+++ b/PublicVolume.cpp
@@ -191,7 +191,8 @@ status_t PublicVolume::doMount() {
usleep(50000); // 50ms
}
/* sdcardfs will have exited already. FUSE will still be running */
- TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG));
+ if (TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG)) == mFusePid)
+ mFusePid = 0;
return OK;
}