diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2026-04-05 15:45:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-05 14:45:27 +0100 |
| commit | 3af9b108909ee1e138cb8b3b6659563ab763e038 (patch) | |
| tree | e76045229a67423fbba4902c46232278cff2e8f6 /src/managers/eventLoop/EventLoopManager.cpp | |
| parent | 3a7bd8fea2ca9711da5523dc185c05ea30ec0f35 (diff) | |
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.
Diffstat (limited to 'src/managers/eventLoop/EventLoopManager.cpp')
| -rw-r--r-- | src/managers/eventLoop/EventLoopManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/managers/eventLoop/EventLoopManager.cpp b/src/managers/eventLoop/EventLoopManager.cpp index b575bcb7..03a8d7c9 100644 --- a/src/managers/eventLoop/EventLoopManager.cpp +++ b/src/managers/eventLoop/EventLoopManager.cpp @@ -4,6 +4,7 @@ #include "../../config/shared/inotify/ConfigWatcher.hpp" #include <algorithm> +#include <cstring> #include <limits> #include <ranges> @@ -41,7 +42,8 @@ static int timerWrite(int fd, uint32_t mask, void* data) { Log::logger->log(Log::ERR, "timerWrite: triggered a non readable event on fd : {}", fd); else { uint64_t expirations; - read(fd, &expirations, sizeof(expirations)); + if (read(fd, &expirations, sizeof(expirations)) < 0) + Log::logger->log(Log::ERR, "timerWrite: read failed on fd {}: {}", fd, strerror(errno)); } g_pEventLoopManager->onTimerFire(); |
