die on pipe failure
This commit is contained in:
parent
79b7e755b0
commit
4d3adea683
1 changed files with 3 additions and 3 deletions
6
dwl.c
6
dwl.c
|
@ -1749,9 +1749,9 @@ run(char *startup_cmd)
|
||||||
/* Now that the socket exists, run the startup command */
|
/* Now that the socket exists, run the startup command */
|
||||||
if (startup_cmd) {
|
if (startup_cmd) {
|
||||||
int piperw[2];
|
int piperw[2];
|
||||||
pipe(piperw);
|
if (pipe(piperw) < 0)
|
||||||
startup_pid = fork();
|
die("startup: pipe:");
|
||||||
if (startup_pid < 0)
|
if ((startup_pid = fork()) < 0)
|
||||||
die("startup: fork:");
|
die("startup: fork:");
|
||||||
if (startup_pid == 0) {
|
if (startup_pid == 0) {
|
||||||
dup2(piperw[0], STDIN_FILENO);
|
dup2(piperw[0], STDIN_FILENO);
|
||||||
|
|
Loading…
Reference in a new issue