From: Michael Stapelberg Date: Sun, 23 Oct 2011 13:31:43 +0000 (+0100) Subject: i3bar: check exit code of pipe() X-Git-Tag: 4.1~75 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=96f67a53a5e927d256499a8c1ce5fb27aa2db3c4;p=i3%2Fi3 i3bar: check exit code of pipe() --- diff --git a/i3bar/src/child.c b/i3bar/src/child.c index 9ab6d23f..c7acd2e6 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "common.h" @@ -131,7 +132,9 @@ void start_child(char *command) { child_pid = 0; if (command != NULL) { int fd[2]; - pipe(fd); + if (pipe(fd) == -1) + err(EXIT_FAILURE, "pipe(fd)"); + child_pid = fork(); switch (child_pid) { case -1: