[fix](be) Scope filesystem error-code imports to their functions

### What problem does this PR solve?

Issue Number: None

Related PR: #67292, #67612, #67579

Problem Summary: With PCH disabled, the IO unity translation unit includes err_utils.cpp before file_meta_cache.cpp. The namespace-scope ErrorCode using-directive leaks into the generated protobuf headers and makes LIMIT_REACH ambiguous. Scope the import to the two localfs_error overloads that use it, preserving the existing error-code mappings. This synchronizes the fix already present in #67579 into the infrastructure and full feature branches.

### Release note

None

### Check List (For Author)

- Test: Manual compiler check. Reproduced the original LIMIT_REACH error in IO unity_2 with PCH imports removed; the same ASAN/UBSAN, coverage and -Werror syntax-only check passes after the fix. Repository clang-format 16, format check, build-hygiene check and git diff --check pass. No full BE build or runtime tests were rerun for this scope-only change.
- Behavior changed: No
- Does this need documentation: No
This commit is contained in:
bobhan1 committed 2026-10-29 16:27:15 +08:00
1 parent e2a4012ad8
commit 8a08ae1999
1 file changed
+2 -2
+2 -2
View File
@@ -28,8 +28,6 @@
#include "io/fs/hdfs.h"
namespace doris {
using namespace ErrorCode;
namespace io {
namespace {
@@ -86,6 +84,7 @@ std::string glob_err_to_str(int code) {
}
Status localfs_error(const std::error_code& ec, std::string_view msg) {
using namespace ErrorCode;
auto message = fmt::format("{}: {}", msg, ec.message());
if (ec == std::errc::io_error) {
return Status::Error<IO_ERROR, false>(message);
@@ -105,6 +104,7 @@ Status localfs_error(const std::error_code& ec, std::string_view msg) {
}
Status localfs_error(int posix_errno, std::string_view msg) {
using namespace ErrorCode;
auto message = fmt::format("{}: {}", msg, errno_message(posix_errno));
switch (posix_errno) {
case EIO: