From d6fe1fae9d5138be15d255084bc354cb3559fc63 Mon Sep 17 00:00:00 2001 From: wujianlin Date: Mon, 19 May 2025 19:47:55 +0800 Subject: [PATCH] Fix the issue of type mismatch in the timerEventHandler on 32-bit systems when printing. Issue:https://gitee.com/openharmony/commonlibrary_c_utils/issues/IC8WME?from=project-issue Signed-off-by: wujianlin --- base/src/timer_event_handler.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/base/src/timer_event_handler.cpp b/base/src/timer_event_handler.cpp index be6c1ab..75e7d41 100644 --- a/base/src/timer_event_handler.cpp +++ b/base/src/timer_event_handler.cpp @@ -98,17 +98,8 @@ void TimerEventHandler::TimeOut() uint64_t expirations = 0; ssize_t n = ::read(GetHandle(), &expirations, sizeof(expirations)); if (n != sizeof(expirations)) { - int erronRead = errno; - struct itimerspec current = { - .it_interval = {.tv_sec = -1, .tv_nsec = -1}, - .it_value = {.tv_sec = -1, .tv_nsec = -1} - }; - if (timerfd_gettime(GetHandle(), ¤t) == -1) { - UTILS_LOGE("timerfd_gettime failed, errno=%{public}d", errno); - } - UTILS_LOGE("epoll_loop::on_timer() reads %{public}d bytes instead of 8, timerFd=%{public}d, errno=%{public}d, " - "Current timer value: %{public}lld sec, %{public}ld nsec", static_cast(n), GetHandle(), - erronRead, current.it_value.tv_sec, current.it_value.tv_nsec); + UTILS_LOGE("epoll_loop::on_timer() reads %{public}d bytes instead of 8, errno=%{public}d", static_cast(n), + errno); } if (callback_) { callback_(GetHandle()); -- Gitee