Merge "adbd: don't abort on EOF on functionfs control fd."
am: 41531df7b0
Change-Id: Id07644b95f53dc14136ed078ecc3cbbf2bfc1ead
This commit is contained in:
commit
f848fac660
1 changed files with 8 additions and 2 deletions
|
@ -297,9 +297,15 @@ struct UsbFfsConnection : public Connection {
|
|||
}
|
||||
|
||||
struct usb_functionfs_event event;
|
||||
if (TEMP_FAILURE_RETRY(adb_read(control_fd_.get(), &event, sizeof(event))) !=
|
||||
sizeof(event)) {
|
||||
rc = TEMP_FAILURE_RETRY(adb_read(control_fd_.get(), &event, sizeof(event)));
|
||||
if (rc == -1) {
|
||||
PLOG(FATAL) << "failed to read functionfs event";
|
||||
} else if (rc == 0) {
|
||||
LOG(WARNING) << "hit EOF on functionfs control fd";
|
||||
break;
|
||||
} else if (rc != sizeof(event)) {
|
||||
LOG(FATAL) << "read functionfs event of unexpected size, expected "
|
||||
<< sizeof(event) << ", got " << rc;
|
||||
}
|
||||
|
||||
LOG(INFO) << "USB event: "
|
||||
|
|
Loading…
Reference in a new issue