From 96f67a53a5e927d256499a8c1ce5fb27aa2db3c4 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 23 Oct 2011 14:31:43 +0100 Subject: [PATCH] i3bar: check exit code of pipe() --- i3bar/src/child.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- 2.39.5