aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-31 12:24:09 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-31 15:32:30 -0600
commit4d3adea68325b70eafbd56a31023f96b92532b8d (patch)
treeb75bf77ddcfbdf7dded6fef6478860ac5a511d32 /dwl.c
parent79b7e755b010fc1486a89a46251a404cb97a341a (diff)
die on pipe failure
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dwl.c b/dwl.c
index bc74c96..ac62120 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1749,9 +1749,9 @@ run(char *startup_cmd)
/* Now that the socket exists, run the startup command */
if (startup_cmd) {
int piperw[2];
- pipe(piperw);
- startup_pid = fork();
- if (startup_pid < 0)
+ if (pipe(piperw) < 0)
+ die("startup: pipe:");
+ if ((startup_pid = fork()) < 0)
die("startup: fork:");
if (startup_pid == 0) {
dup2(piperw[0], STDIN_FILENO);