Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c706bae authored by Daniel Colascione's avatar Daniel Colascione
Browse files

Improve codegen slightly when doing FD validity checks

See https://gcc.godbolt.org/z/hGUZIk

Test: inspection
Bug: 140506797
Change-Id: I6fe87b16e18c93b7fc3ca28edbbc68c245e7e5e5
parent c3163e76
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -120,7 +120,7 @@ class unique_fd_impl final {
  // Catch bogus error checks (i.e.: "!fd" instead of "fd != -1").
  // Catch bogus error checks (i.e.: "!fd" instead of "fd != -1").
  bool operator!() const = delete;
  bool operator!() const = delete;


  bool ok() const { return get() != -1; }
  bool ok() const { return get() >= 0; }


  int release() __attribute__((warn_unused_result)) {
  int release() __attribute__((warn_unused_result)) {
    tag(fd_, this, nullptr);
    tag(fd_, this, nullptr);