Skip to content

Commit

Permalink
Merge pull request #2366 from zjeffer/fix/build-warnings
Browse files Browse the repository at this point in the history
Fixed sway IPC compile warnings
  • Loading branch information
Alexays authored Jul 30, 2023
2 parents b09f6cc + 28635c1 commit 8882826
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/modules/sway/ipc/client.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "modules/sway/ipc/client.hpp"

#include <fcntl.h>
#include <spdlog/spdlog.h>

#include <stdexcept>

Expand All @@ -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;
}
Expand Down

0 comments on commit 8882826

Please sign in to comment.