mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
explicitly checking for errors to silence unused variable warnings when writing to fd
This commit is contained in:
@ -68,7 +68,9 @@ inline int close(FILE* fp, pid_t pid) {
|
||||
inline FILE* open(const std::string& cmd, int& pid) {
|
||||
if (cmd == "") return nullptr;
|
||||
int fd[2];
|
||||
pipe(fd);
|
||||
if (pipe(fd) != 0){
|
||||
throw std::runtime_error("Couldn't open a file descriptor");
|
||||
}
|
||||
|
||||
pid_t child_pid = fork();
|
||||
|
||||
|
Reference in New Issue
Block a user