Skip to content

Commit fde2ffb

Browse files
committed
silence EINTR "error" condition
1 parent b511e65 commit fde2ffb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/ocvsmd/platform/bsd/kqueue_single_threaded_executor.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ class KqueueSingleThreadedExecutor final : public libcyphal::platform::SingleThr
108108
if (kqueue_result < 0)
109109
{
110110
const auto err = errno;
111+
if (err == EINTR)
112+
{
113+
// Normally, we would just retry a system call (`::kevent`),
114+
// but we need updated timeout (from the main loop).
115+
return cetl::nullopt;
116+
}
111117
return libcyphal::transport::PlatformError{PosixPlatformError{err}};
112118
}
113119
if (kqueue_result == 0)

include/ocvsmd/platform/linux/epoll_single_threaded_executor.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ class EpollSingleThreadedExecutor final : public libcyphal::platform::SingleThre
9999
if (epoll_result < 0)
100100
{
101101
const auto err = errno;
102+
if (err == EINTR)
103+
{
104+
// Normally, we would just retry a system call (`::epoll_wait`),
105+
// but we need updated timeout (from the main loop).
106+
return cetl::nullopt;
107+
}
102108
return libcyphal::transport::PlatformError{PosixPlatformError{err}};
103109
}
104110
if (epoll_result == 0)

0 commit comments

Comments
 (0)