Use unique_fd
Also allow the state just before doMount() as a valid state for setting
fuse fd.
Test: manual
BUG:140173712
Change-Id: I012f8a83fef00e68f33010954fbc2ebc53cf8f1d
diff --git a/Utils.h b/Utils.h
index cd55b09..e0102a7 100644
--- a/Utils.h
+++ b/Utils.h
@@ -20,6 +20,7 @@
#include "KeyBuffer.h"
#include <android-base/macros.h>
+#include <android-base/unique_fd.h>
#include <cutils/multiuser.h>
#include <selinux/selinux.h>
#include <utils/Errors.h>
@@ -150,7 +151,8 @@
bool writeStringToFile(const std::string& payload, const std::string& filename);
-int MountUserFuse(userid_t user_id, const std::string& relative_path, int* device_fd);
+int MountUserFuse(userid_t user_id, const std::string& relative_path,
+ android::base::unique_fd* fuse_fd);
} // namespace vold
} // namespace android