diff options
| author | 2019-08-01 11:27:50 -0700 | |
|---|---|---|
| committer | 2019-08-01 11:27:50 -0700 | |
| commit | 896ac8909febde28e48797d3fd7fcf7bab7349d1 (patch) | |
| tree | a17656fdbc0b170bf92e9dd9d30fa328bfd03c2b | |
| parent | ddd31679fe19dd8292f95e173a02346de1482287 (diff) | |
| parent | 3e1b23b387ed73229c1c05de318176e6718ea346 (diff) | |
Merge "Fix FD comparisons in binder" am: 1a9db5066b am: f18ddef416 am: f09b6060ad am: d844863aca
am: 3e1b23b387
Change-Id: I31c4b88ca3e4ef3cf3a2cbbb6133f658c31712e5
| -rw-r--r-- | libs/binder/IPCThreadState.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index cfb86f021c..7c45c775c7 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -465,7 +465,7 @@ void IPCThreadState::clearCaller() void IPCThreadState::flushCommands() { - if (mProcess->mDriverFD <= 0) + if (mProcess->mDriverFD < 0) return; talkWithDriver(false); // The flush could have caused post-write refcount decrements to have @@ -618,7 +618,7 @@ void IPCThreadState::joinThreadPool(bool isMain) int IPCThreadState::setupPolling(int* fd) { - if (mProcess->mDriverFD <= 0) { + if (mProcess->mDriverFD < 0) { return -EBADF; } @@ -924,7 +924,7 @@ finish: status_t IPCThreadState::talkWithDriver(bool doReceive) { - if (mProcess->mDriverFD <= 0) { + if (mProcess->mDriverFD < 0) { return -EBADF; } @@ -982,7 +982,7 @@ status_t IPCThreadState::talkWithDriver(bool doReceive) #else err = INVALID_OPERATION; #endif - if (mProcess->mDriverFD <= 0) { + if (mProcess->mDriverFD < 0) { err = -EBADF; } IF_LOG_COMMANDS() { @@ -1301,7 +1301,7 @@ void IPCThreadState::threadDestructor(void *st) if (self) { self->flushCommands(); #if defined(__ANDROID__) - if (self->mProcess->mDriverFD > 0) { + if (self->mProcess->mDriverFD >= 0) { ioctl(self->mProcess->mDriverFD, BINDER_THREAD_EXIT, 0); } #endif |