maybe we shouldn't actually runtime error, but still doing a check

pull/1312/head
mazunki 2021-11-09 19:03:15 +01:00
parent 17bb5643ae
commit b0eab5d793
2 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ inline FILE* open(const std::string& cmd, int& pid) {
if (cmd == "") return nullptr; if (cmd == "") return nullptr;
int fd[2]; int fd[2];
if (pipe(fd) != 0){ if (pipe(fd) != 0){
throw std::runtime_error("Couldn't open a file descriptor"); // std::runtime_error("Couldn't open a file descriptor");
} }
pid_t child_pid = fork(); pid_t child_pid = fork();

View File

@ -15,14 +15,14 @@ Ipc::~Ipc() {
if (fd_ > 0) { if (fd_ > 0) {
// To fail the IPC header // To fail the IPC header
if (write(fd_, "close-sway-ipc", 14) == -1) { if (write(fd_, "close-sway-ipc", 14) == -1) {
std::runtime_error("Couldn't close Sway IPC through fd"); //std::runtime_error("Couldn't close Sway IPC through fd");
} }
close(fd_); close(fd_);
fd_ = -1; fd_ = -1;
} }
if (fd_event_ > 0) { if (fd_event_ > 0) {
if (write(fd_event_, "close-sway-ipc", 14) == -1) { if (write(fd_event_, "close-sway-ipc", 14) == -1) {
std::runtime_error("Couldn't close Sway IPC through fd_event"); //std::runtime_error("Couldn't close Sway IPC through fd_event");
} }
close(fd_event_); close(fd_event_);
fd_event_ = -1; fd_event_ = -1;