diff --git a/interfaces/common/include/log.h b/interfaces/common/include/log.h index 207318f3007cfdfd3350f7fa421a9b44fb486e00..c941a611d31eaee5f41c20ecad2cdf6882481530 100644 --- a/interfaces/common/include/log.h +++ b/interfaces/common/include/log.h @@ -29,7 +29,7 @@ static constexpr OHOS::HiviewDFX::HiLogLabel LOG_LABEL = { LOG_CORE, APP_LOG_DOM #define LOGI(fmt, ...) PRINT_LOG(Info, fmt, ##__VA_ARGS__) #define LOGW(fmt, ...) PRINT_LOG(Warn, fmt, ##__VA_ARGS__) -#define LOGD(fmt, ...) PRINT_LOG(Warn, fmt, ##__VA_ARGS__) +#define LOGD(fmt, ...) PRINT_LOG(Debug, fmt, ##__VA_ARGS__) #define LOGE(fmt, ...) PRINT_LOG(Error, fmt, ##__VA_ARGS__) #define LOGF(fmt, ...) PRINT_LOG(Fatal, fmt, ##__VA_ARGS__) } // namespace AppFileService diff --git a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp index dd20f224f351a41c43a1a2c3db94d939cd0dd237..4d272b21acf655c7589f25d0e580c883dbaedc95 100644 --- a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp +++ b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp @@ -333,9 +333,11 @@ int32_t RemoteFileShare::GetDfsUriFromLocal(const std::string &uriStr, const int ret = ioctl(dirFd, HMDFS_IOC_GET_DST_PATH, &hdi); if (ret != 0) { LOGE("Ioctl failed with %{public}d", errno); + close(dirFd); return -errno; } + close(dirFd); SetHmdfsUriInfo(hui, uri, hdi.size); LOGD("GetDfsUriFromLocal successfully with %{public}s", hui.uriStr.c_str()); return 0;