diff options
author | Daniel Colascione <dancol@google.com> | 2019-09-04 18:20:24 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-09-04 18:20:24 -0700 |
commit | 2378575dac467fbda73e2e50dc9fc3140864eeed (patch) | |
tree | bcb64e74562bdd8dcb1a6a9e764ebee2f93c09e7 | |
parent | 362853af1a218d2d315181c9b790b5cec8ccd1df (diff) | |
parent | 9ad079ba58cd8803afcd2fa9fc43fd752b3e83b2 (diff) | |
download | core-2378575dac467fbda73e2e50dc9fc3140864eeed.tar.gz |
Merge "Improve codegen slightly when doing FD validity checks"
am: 9ad079ba58
Change-Id: I4262f086b9041bb28536cf2c7598817fac63b8cc
-rw-r--r-- | base/include/android-base/unique_fd.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/include/android-base/unique_fd.h b/base/include/android-base/unique_fd.h index 6e11b4ee7..1605daf71 100644 --- a/base/include/android-base/unique_fd.h +++ b/base/include/android-base/unique_fd.h @@ -120,7 +120,7 @@ class unique_fd_impl final { // Catch bogus error checks (i.e.: "!fd" instead of "fd != -1"). bool operator!() const = delete; - bool ok() const { return get() != -1; } + bool ok() const { return get() >= 0; } int release() __attribute__((warn_unused_result)) { tag(fd_, this, nullptr); |