From 3af9b108909ee1e138cb8b3b6659563ab763e038 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Sun, 5 Apr 2026 15:45:27 +0200 Subject: internal: silence compiler warnings about unused return values (#13997) * misc: silence warnings about ignoring return value on reads silence warnings on ignored return values on read() and print an error if it occurs. * misc: silence warnings about ignoring return value on writes silence warnings on ignored return values on write() and print an error where we can, or pass them the maybe_unused attribute. * misc: silence warnings about ignoring return value on pipe silence warnings on ignored return value on pipe(), print an error and exit on failure. --- src/helpers/MainLoopExecutor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/helpers/MainLoopExecutor.cpp') diff --git a/src/helpers/MainLoopExecutor.cpp b/src/helpers/MainLoopExecutor.cpp index c7b5f910..bd17fe5d 100644 --- a/src/helpers/MainLoopExecutor.cpp +++ b/src/helpers/MainLoopExecutor.cpp @@ -1,6 +1,7 @@ #include "MainLoopExecutor.hpp" #include "../managers/eventLoop/EventLoopManager.hpp" #include "../macros.hpp" +#include #include static int onDataRead(int fd, uint32_t mask, void* data) { @@ -26,7 +27,8 @@ CMainLoopExecutor::~CMainLoopExecutor() { void CMainLoopExecutor::signal() { const char* amogus = "h"; - write(m_writeFd.get(), amogus, 1); + if (write(m_writeFd.get(), amogus, 1) < 0) + Log::logger->log(Log::ERR, "signal: failed to write to fd {}: {}", m_writeFd.get(), strerror(errno)); } void CMainLoopExecutor::onFired() { -- cgit v1.2.3