diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-03 20:23:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-03 20:23:59 +0000 |
commit | f6dbba884632e4770011f389559da673b5529935 (patch) | |
tree | d3f4cd11b14de549aeba3892c4cd6e25b7d01a07 | |
parent | 456483d19379391b05be2363cc740ee2d93b10e3 (diff) | |
parent | 8b9a5b344e9f467621f07040567e5231da413f46 (diff) | |
download | vold-o-mr1-iot-preview-8.tar.gz |
Merge "Remove waitpid on UnMount"android-wear-p-preview-2android-p-preview-3android-p-preview-2android-o-mr1-iot-release-1.0.0android-o-mr1-iot-preview-8android-n-iot-release-lg-thinq-wk7o-mr1-iot-preview-8
-rw-r--r-- | EmulatedVolume.cpp | 10 | ||||
-rw-r--r-- | PublicVolume.cpp | 10 |
2 files changed, 4 insertions, 16 deletions
diff --git a/EmulatedVolume.cpp b/EmulatedVolume.cpp index 71eaa3ea..6fa66d50 100644 --- a/EmulatedVolume.cpp +++ b/EmulatedVolume.cpp @@ -105,8 +105,8 @@ status_t EmulatedVolume::doMount() { usleep(50000); // 50ms } /* sdcardfs will have exited already. FUSE will still be running */ - if (TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG)) == mFusePid) - mFusePid = 0; + TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0)); + mFusePid = 0; return OK; } @@ -121,12 +121,6 @@ status_t EmulatedVolume::doUnmount() { ForceUnmount(mFuseRead); ForceUnmount(mFuseWrite); - if (mFusePid > 0) { - kill(mFusePid, SIGTERM); - TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0)); - mFusePid = 0; - } - rmdir(mFuseDefault.c_str()); rmdir(mFuseRead.c_str()); rmdir(mFuseWrite.c_str()); diff --git a/PublicVolume.cpp b/PublicVolume.cpp index 4643a3ac..929f587f 100644 --- a/PublicVolume.cpp +++ b/PublicVolume.cpp @@ -191,8 +191,8 @@ status_t PublicVolume::doMount() { usleep(50000); // 50ms } /* sdcardfs will have exited already. FUSE will still be running */ - if (TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG)) == mFusePid) - mFusePid = 0; + TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0)); + mFusePid = 0; return OK; } @@ -211,12 +211,6 @@ status_t PublicVolume::doUnmount() { ForceUnmount(mFuseWrite); ForceUnmount(mRawPath); - if (mFusePid > 0) { - kill(mFusePid, SIGTERM); - TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0)); - mFusePid = 0; - } - rmdir(mFuseDefault.c_str()); rmdir(mFuseRead.c_str()); rmdir(mFuseWrite.c_str()); |