die on pipe failure

This commit is contained in:
Leonardo Hernández Hernández 2022-03-31 12:24:09 -06:00 committed by Palanix
parent 688aae101b
commit 2ad87169d1

6
dwl.c
View File

@ -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);