diff options
author | Tomasz Wasilczyk <twasilczyk@google.com> | 2023-11-16 10:17:54 -0800 |
---|---|---|
committer | Tomasz Wasilczyk <twasilczyk@google.com> | 2023-11-20 12:42:35 -0800 |
commit | 3202460dda991e79ff5c9fc77daf4bd484bb23e6 (patch) | |
tree | c254156bdf17f7824b0b473008d8306bd4a9fbfa /include | |
parent | 8f33166621a04db00e1c0ec6d67884bc0b7f8849 (diff) | |
download | native-3202460dda991e79ff5c9fc77daf4bd484bb23e6.tar.gz |
input: don't depend on unique_fd cast to int
Also, reuse dupFd method instead of calling ::dup directly.
Test: m libinput
Test: m libinputdispatcher
Bug: 302723053
Change-Id: Ie6e4f1ea9cfc00b4c2be44dcc8922a17de129cfb
Diffstat (limited to 'include')
-rw-r--r-- | include/input/InputTransport.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/input/InputTransport.h b/include/input/InputTransport.h index 4f53c36d6f..59b9495c42 100644 --- a/include/input/InputTransport.h +++ b/include/input/InputTransport.h @@ -240,7 +240,7 @@ public: android::base::unique_fd fd, sp<IBinder> token); InputChannel() = default; InputChannel(const InputChannel& other) - : mName(other.mName), mFd(::dup(other.mFd)), mToken(other.mToken){}; + : mName(other.mName), mFd(other.dupFd()), mToken(other.mToken){}; InputChannel(const std::string name, android::base::unique_fd fd, sp<IBinder> token); ~InputChannel() override; /** @@ -310,7 +310,7 @@ public: if (fstat(mFd.get(), &lhs) != 0) { return false; } - if (fstat(inputChannel.getFd(), &rhs) != 0) { + if (fstat(inputChannel.getFd().get(), &rhs) != 0) { return false; } // If file descriptors are pointing to same inode they are duplicated fds. @@ -322,7 +322,7 @@ private: base::unique_fd dupFd() const; std::string mName; - android::base::unique_fd mFd; + base::unique_fd mFd; sp<IBinder> mToken; }; |