diff --git a/services/sandbox_manager/main/cpp/src/mac/mac_adapter.cpp b/services/sandbox_manager/main/cpp/src/mac/mac_adapter.cpp index c43361bd7703d091c3a6da14fe5416d4170204fd..92cb1fdd57eba15716e9210c592a0e13aa48b883 100644 --- a/services/sandbox_manager/main/cpp/src/mac/mac_adapter.cpp +++ b/services/sandbox_manager/main/cpp/src/mac/mac_adapter.cpp @@ -84,6 +84,9 @@ void MacAdapter::Init() SANDBOXMANAGER_LOG_INFO(LABEL, "Node exists, mac is support."); isMacSupport_ = true; } + if (fd_ > 0) { + return; + } fd_ = open(DEV_NODE, O_RDWR); if (fd_ < 0) { SANDBOXMANAGER_LOG_ERROR(LABEL, "Open node failed, errno=%{public}d.", errno);