From c286096ac90939610bdceced65d5ef3900cffb45 Mon Sep 17 00:00:00 2001 From: huangyuchen Date: Mon, 8 May 2023 15:18:16 +0800 Subject: [PATCH] Rename header file to avoid potential conflict. Issue:I7194K Test:NA Signed-off-by: huangyuchen Change-Id: I016757b5c13b2b37c4c08262295f94d630621bb2 --- base/include/{event.h => io_event_common.h} | 8 ++++---- base/include/io_event_handler.h | 2 +- base/include/io_event_reactor.h | 2 +- base/src/io_event_epoll.cpp | 6 +++--- base/src/io_event_epoll.h | 2 +- base/src/io_event_handler.cpp | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) rename base/include/{event.h => io_event_common.h} (89%) diff --git a/base/include/event.h b/base/include/io_event_common.h similarity index 89% rename from base/include/event.h rename to base/include/io_event_common.h index 4ff6702..5ae67aa 100644 --- a/base/include/event.h +++ b/base/include/io_event_common.h @@ -16,8 +16,8 @@ #include #include -#ifndef UTILS_EVENT_H -#define UTILS_EVENT_H +#ifndef UTILS_IO_EVENT_COMMON_H +#define UTILS_IO_EVENT_COMMON_H namespace OHOS { namespace Utils { @@ -29,7 +29,7 @@ using REventId = EventId; using EventCallback = std::function; -static constexpr int INVALID_FD = -1; +static constexpr int IO_EVENT_INVALID_FD = -1; namespace Events { @@ -43,4 +43,4 @@ namespace Events { } // namespace Utils } // namespace OHOS -#endif /* UTILS_EVENT_H */ \ No newline at end of file +#endif /* UTILS_IO_EVENT_COMMON_H */ \ No newline at end of file diff --git a/base/include/io_event_handler.h b/base/include/io_event_handler.h index 7b3af32..a581063 100644 --- a/base/include/io_event_handler.h +++ b/base/include/io_event_handler.h @@ -17,7 +17,7 @@ #define UTILS_EVENT_HANDLER_H #include "errors.h" -#include "event.h" +#include "io_event_common.h" namespace OHOS { namespace Utils { diff --git a/base/include/io_event_reactor.h b/base/include/io_event_reactor.h index 8bc2fec..f5d0fb1 100644 --- a/base/include/io_event_reactor.h +++ b/base/include/io_event_reactor.h @@ -23,7 +23,7 @@ #include #include #include -#include "event.h" +#include "io_event_common.h" #include "errors.h" #include "io_event_handler.h" diff --git a/base/src/io_event_epoll.cpp b/base/src/io_event_epoll.cpp index 5b0a4d5..0001d42 100644 --- a/base/src/io_event_epoll.cpp +++ b/base/src/io_event_epoll.cpp @@ -19,7 +19,7 @@ #include #include #include "utils_log.h" -#include "event.h" +#include "io_event_common.h" #include "common_event_sys_errors.h" #include "io_event_epoll.h" @@ -46,11 +46,11 @@ ErrCode IOEventEpoll::SetUp() void IOEventEpoll::CleanUp() { - if (epollFd_ != INVALID_FD) { + if (epollFd_ != IO_EVENT_INVALID_FD) { if (close(epollFd_) != 0) { UTILS_LOGW("%{public}s: Failed, cannot close fd: %{public}s.", __FUNCTION__, strerror(errno)); } - epollFd_ = INVALID_FD; + epollFd_ = IO_EVENT_INVALID_FD; } } diff --git a/base/src/io_event_epoll.h b/base/src/io_event_epoll.h index 770dc87..5ef4d3b 100644 --- a/base/src/io_event_epoll.h +++ b/base/src/io_event_epoll.h @@ -20,7 +20,7 @@ #include #include #include -#include "event.h" +#include "io_event_common.h" #include "errors.h" namespace OHOS { diff --git a/base/src/io_event_handler.cpp b/base/src/io_event_handler.cpp index 432ca80..f6a12a5 100644 --- a/base/src/io_event_handler.cpp +++ b/base/src/io_event_handler.cpp @@ -22,7 +22,7 @@ namespace OHOS { namespace Utils { IOEventHandler::IOEventHandler() - :prev_(nullptr), next_(nullptr), fd_(INVALID_FD), events_(Events::EVENT_NONE), cb_(nullptr), enabled_(false) {} + :prev_(nullptr), next_(nullptr), fd_(IO_EVENT_INVALID_FD), events_(Events::EVENT_NONE), cb_(nullptr), enabled_(false) {} IOEventHandler::IOEventHandler(int fd, EventId events, const EventCallback& cb) :prev_(nullptr), next_(nullptr), fd_(fd), events_(events), cb_(cb), enabled_(false) {} -- Gitee