From f3fe82aca7526b3fc8c289d2d4445621284c6874 Mon Sep 17 00:00:00 2001 From: xxxx Date: Fri, 13 Jan 2023 11:14:31 +0800 Subject: [PATCH] Description:Repair Cppcheck Alarm Match-id-b13726638f74c5b363a91e154f858480c077c51a --- common/include/input_hub.cpp | 2 +- common/include/input_hub.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/include/input_hub.cpp b/common/include/input_hub.cpp index 15d5514..8d8f89a 100644 --- a/common/include/input_hub.cpp +++ b/common/include/input_hub.cpp @@ -445,7 +445,7 @@ void InputHub::ScanInputDevices(const std::string& dirname) closedir(dir); } -void InputHub::CloseFd(int fd) +void InputHub::CloseFd(int& fd) { if (fd < 0) { DHLOGE("No fd need to be closed."); diff --git a/common/include/input_hub.h b/common/include/input_hub.h index d39b11d..24fb84e 100644 --- a/common/include/input_hub.h +++ b/common/include/input_hub.h @@ -121,7 +121,7 @@ private: Device* GetDeviceByPathLocked(const std::string& devicePath); Device* GetDeviceByFdLocked(int fd); Device* GetSupportDeviceByFd(int fd); - void CloseFd(int fd); + void CloseFd(int& fd); bool IsDeviceRegistered(const std::string& devicePath); bool ContainsNonZeroByte(const uint8_t* array, uint32_t startIndex, uint32_t endIndex);