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/xwayland/Server.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/xwayland/Server.cpp') diff --git a/src/xwayland/Server.cpp b/src/xwayland/Server.cpp index 9d40e1c9..b33dbfb5 100644 --- a/src/xwayland/Server.cpp +++ b/src/xwayland/Server.cpp @@ -222,7 +222,10 @@ bool CXWaylandServer::tryOpenSockets() { continue; char pidstr[12] = {0}; - read(fd.get(), pidstr, sizeof(pidstr) - 1); + if (read(fd.get(), pidstr, sizeof(pidstr) - 1) < 0) { + Log::logger->log(Log::ERR, "Failed to read on fd {}: {}", fd.get(), strerror(errno)); + continue; + } int32_t pid = 0; try { -- cgit v1.2.3