Skip to content

Commit

Permalink
Fixed sway IPC compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zjeffer committed Jul 30, 2023
1 parent b09f6cc commit 28635c1
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 28635c1

Please sign in to comment.