• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Revision82ebfca5cdaefaeaae95a5fe641bdf594b6ac2cd (tree)
Zeit2019-05-14 07:21:59
AutorTreeHugger Robot <treehugger-gerrit@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "adbd: don't abort on EOF on functionfs control fd." into qt-dev

Ändern Zusammenfassung

Diff

--- a/adb/daemon/usb.cpp
+++ b/adb/daemon/usb.cpp
@@ -295,9 +295,15 @@ struct UsbFfsConnection : public Connection {
295295 }
296296
297297 struct usb_functionfs_event event;
298- if (TEMP_FAILURE_RETRY(adb_read(control_fd_.get(), &event, sizeof(event))) !=
299- sizeof(event)) {
298+ rc = TEMP_FAILURE_RETRY(adb_read(control_fd_.get(), &event, sizeof(event)));
299+ if (rc == -1) {
300300 PLOG(FATAL) << "failed to read functionfs event";
301+ } else if (rc == 0) {
302+ LOG(WARNING) << "hit EOF on functionfs control fd";
303+ break;
304+ } else if (rc != sizeof(event)) {
305+ LOG(FATAL) << "read functionfs event of unexpected size, expected "
306+ << sizeof(event) << ", got " << rc;
301307 }
302308
303309 LOG(INFO) << "USB event: "