Enable Android clang-tidy checks for inputflinger
Mostly just adding CLOEXEC to any operations that open a new fd.
Bug: 218657035
Test: build
Change-Id: Iae1a32bfdbb663759fb347af7e3426b03d5f831f
diff --git a/services/inputflinger/tests/UinputDevice.cpp b/services/inputflinger/tests/UinputDevice.cpp
index 132b877..9c93919 100644
--- a/services/inputflinger/tests/UinputDevice.cpp
+++ b/services/inputflinger/tests/UinputDevice.cpp
@@ -17,6 +17,7 @@
#include "UinputDevice.h"
#include <android-base/stringprintf.h>
+#include <fcntl.h>
namespace android {
@@ -32,7 +33,7 @@
}
void UinputDevice::init() {
- mDeviceFd = android::base::unique_fd(open("/dev/uinput", O_WRONLY | O_NONBLOCK));
+ mDeviceFd = android::base::unique_fd(open("/dev/uinput", O_WRONLY | O_NONBLOCK | O_CLOEXEC));
if (mDeviceFd < 0) {
FAIL() << "Can't open /dev/uinput :" << strerror(errno);
}