mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Fixed sway IPC compile warnings
This commit is contained in:
parent
b09f6cc731
commit
28635c1f6d
@ -1,6 +1,7 @@
|
|||||||
#include "modules/sway/ipc/client.hpp"
|
#include "modules/sway/ipc/client.hpp"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <spdlog/spdlog.h>
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
@ -17,12 +18,16 @@ Ipc::~Ipc() {
|
|||||||
|
|
||||||
if (fd_ > 0) {
|
if (fd_ > 0) {
|
||||||
// To fail the IPC header
|
// 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_);
|
close(fd_);
|
||||||
fd_ = -1;
|
fd_ = -1;
|
||||||
}
|
}
|
||||||
if (fd_event_ > 0) {
|
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_);
|
close(fd_event_);
|
||||||
fd_event_ = -1;
|
fd_event_ = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user