Merge "mFusePid should be cleared after waitpid successfully" am: 456483d193 am: 8be3be3167
am: 8fe7f3104b
Change-Id: I18199ce5f972f0a403728e34dec608a01fceb183
diff --git a/model/EmulatedVolume.cpp b/model/EmulatedVolume.cpp
index 7f5c4ff..31c3924 100644
--- a/model/EmulatedVolume.cpp
+++ b/model/EmulatedVolume.cpp
@@ -114,7 +114,8 @@
}
}
/* 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/model/PublicVolume.cpp b/model/PublicVolume.cpp
index efdb687..fc7e96f 100644
--- a/model/PublicVolume.cpp
+++ b/model/PublicVolume.cpp
@@ -211,7 +211,8 @@
}
}
/* 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;
}