Transfer /dev/mtp_usb fd ownership when instancing MtpDevHandle
/dev/mtp_usb was opened before instancing MtpDevHandle, the existing fd should be passed in otherwise MtpDevHandle::start would be blocked as it attempted to open the device twice. Change-Id: I6afc5b6926930dad77aceac2f6a00e1c6759a883
This commit is contained in:
@@ -33,8 +33,9 @@
|
||||
|
||||
constexpr char mtp_dev_path[] = "/dev/mtp_usb";
|
||||
|
||||
MtpDevHandle::MtpDevHandle()
|
||||
: mFd(-1) {};
|
||||
MtpDevHandle::MtpDevHandle(int controlFd) {
|
||||
mFd.reset(controlFd);
|
||||
}
|
||||
|
||||
MtpDevHandle::~MtpDevHandle() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user