修改告警

Signed-off-by: litiangang4 <litiangang4@huawei.com>
This commit is contained in:
litiangang4
2023-08-02 16:20:11 +08:00
parent cc1181303d
commit 503c8747ec
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -424,7 +424,7 @@ void InputHub::ScanInputDevices(const std::string& dirName)
DHLOGI("ScanInputDevices enter, dirName %s.", dirName.c_str());
std::vector<std::string> vecInputDevPath;
ScanInputDevicesPath(dirName, vecInputDevPath);
for (auto &tempPath: vecInputDevPath) {
for (const auto &tempPath: vecInputDevPath) {
OpenInputDeviceLocked(tempPath);
}
}
+2 -2
View File
@@ -53,9 +53,9 @@ std::string Sha256(const std::string& string);
void CloseFd(int& fd);
int BitIsSet(const unsigned long *array, int bit);
void StringSplitToVector(const std::string& str, const char split, std::vector<std::string>& vecStr);
int OpenInputDeviceFdByPath(std::string devicePath);
int OpenInputDeviceFdByPath(const std::string &devicePath);
std::string ConvertErrNo();
void ScanInputDevicesPath(std::string dirName, std::vector<std::string>& vecInputDevPath);
void ScanInputDevicesPath(const std::string &dirName, std::vector<std::string>& vecInputDevPath);
} // namespace DistributedInput
} // namespace DistributedHardware
} // namespace OHOS
+2 -2
View File
@@ -324,7 +324,7 @@ void StringSplitToVector(const std::string& str, const char split, std::vector<s
}
}
int OpenInputDeviceFdByPath(std::string devicePath)
int OpenInputDeviceFdByPath(const std::string &devicePath)
{
chmod(devicePath.c_str(), S_IWRITE | S_IREAD);
char canonicalDevicePath[PATH_MAX] = {0x00};
@@ -362,7 +362,7 @@ std::string ConvertErrNo()
return errNoMsg;
}
void ScanInputDevicesPath(std::string dirName, std::vector<std::string>& vecInputDevPath)
void ScanInputDevicesPath(const std::string &dirName, std::vector<std::string>& vecInputDevPath)
{
DIR *dir;
struct dirent *de;