commit | 21e0a8da8a067ae53479144fea6a2e5955d0ad22 | [log] [tgz] |
---|---|---|
author | George Chang <georgekgchang@google.com> | Tue Jul 27 12:32:56 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jul 27 12:32:56 2021 +0000 |
tree | 1514a951b987e356b6ade4a50466a0e063498024 | |
parent | 6590bbe1787cad5d5406853fc278717b055991b5 [diff] | |
parent | 2381a69e9e4f96c3ab97ea644357931a3d2033ee [diff] |
Fix abnormal file io am: 83ef539448 am: d885e15cf0 am: 2381a69e9e Original change: https://android-review.googlesource.com/c/platform/hardware/st/nfc/+/1778416 Change-Id: I0b7025b1a39f3ba138407e60eaa126701e4c6f29
diff --git a/st21nfc/adaptation/i2clayer.cc b/st21nfc/adaptation/i2clayer.cc index c7b1300..33b54eb 100644 --- a/st21nfc/adaptation/i2clayer.cc +++ b/st21nfc/adaptation/i2clayer.cc
@@ -88,7 +88,7 @@ HALHANDLE hHAL = (HALHANDLE)arg; STLOG_HAL_D("echo thread started...\n"); bool readOk = false; - int eventNum = (notifyResetRequest < 0) ? 2 : 3; + int eventNum = (notifyResetRequest <= 0) ? 2 : 3; bool reseting = false; do { @@ -233,7 +233,9 @@ close(fidI2c); close(cmdPipe[0]); close(cmdPipe[1]); - close(notifyResetRequest); + if (notifyResetRequest > 0) { + close(notifyResetRequest); + } HalDestroy(hHAL); STLOG_HAL_D("thread exit\n");