From 28635c1f6d580442709fc68d69c40d4950175e0d Mon Sep 17 00:00:00 2001 From: zjeffer <4633209+zjeffer@users.noreply.github.com> Date: Sun, 30 Jul 2023 11:43:34 +0200 Subject: [PATCH] Fixed sway IPC compile warnings --- src/modules/sway/ipc/client.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/sway/ipc/client.cpp b/src/modules/sway/ipc/client.cpp index 5c3df7b2..4139a53b 100644 --- a/src/modules/sway/ipc/client.cpp +++ b/src/modules/sway/ipc/client.cpp @@ -1,6 +1,7 @@ #include "modules/sway/ipc/client.hpp" #include +#include #include @@ -17,12 +18,16 @@ Ipc::~Ipc() { if (fd_ > 0) { // To fail the IPC header - write(fd_, "close-sway-ipc", 14); + if (write(fd_, "close-sway-ipc", 14) == -1) { + spdlog::error("Failed to close sway IPC"); + } close(fd_); fd_ = -1; } if (fd_event_ > 0) { - write(fd_event_, "close-sway-ipc", 14); + if (write(fd_event_, "close-sway-ipc", 14) == -1) { + spdlog::error("Failed to close sway IPC event handler"); + } close(fd_event_); fd_event_ = -1; }