!249 修改异常UT用例,重复关闭fd

Merge pull request !249 from 李天刚/master
This commit is contained in:
openharmony_ci
2025-01-27 03:02:21 +00:00
committed by Gitee
+1 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
* Copyright (c) 2021-2025 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -567,7 +567,6 @@ int32_t InputHub::OpenInputDeviceLocked(const std::string &devicePath)
RecordDeviceLog(devicePath, device->identifier);
std::string descriptor = device->identifier.descriptor;
if (MakeDevice(fd, std::move(device)) < 0) {
CloseFd(fd);
if (IsNeedPrintLog(descriptor)) {
DHLOGI("Opening device error: %{public}s", devicePath.c_str());
}