summaryrefslogtreecommitdiff
path: root/src/libcamera/event_dispatcher_poll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/event_dispatcher_poll.cpp')
-rw-r--r--src/libcamera/event_dispatcher_poll.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp
index 1f0f352a..0ff99fce 100644
--- a/src/libcamera/event_dispatcher_poll.cpp
+++ b/src/libcamera/event_dispatcher_poll.cpp
@@ -162,7 +162,14 @@ void EventDispatcherPoll::processEvents()
void EventDispatcherPoll::interrupt()
{
uint64_t value = 1;
- write(eventfd_, &value, sizeof(value));
+ ssize_t ret = write(eventfd_, &value, sizeof(value));
+ if (ret != sizeof(value)) {
+ if (ret < 0)
+ ret = -errno;
+ LOG(Event, Error)
+ << "Failed to interrupt event dispatcher ("
+ << ret << ")";
+ }
}
short EventDispatcherPoll::EventNotifierSetPoll::events() const
@@ -214,7 +221,13 @@ void EventDispatcherPoll::processInterrupt(const struct pollfd &pfd)
return;
uint64_t value;
- read(eventfd_, &value, sizeof(value));
+ ssize_t ret = read(eventfd_, &value, sizeof(value));
+ if (ret != sizeof(value)) {
+ if (ret < 0)
+ ret = -errno;
+ LOG(Event, Error)
+ << "Failed to process interrupt (" << ret << ")";
+ }
}
void EventDispatcherPoll::processNotifiers(const std::vector<struct pollfd> &pollfds)