~ruther/dwl

4d3adea68325b70eafbd56a31023f96b92532b8d — Leonardo Hernández Hernández 3 years ago 79b7e75
die on pipe failure
1 files changed, 3 insertions(+), 3 deletions(-)

M dwl.c
M dwl.c => dwl.c +3 -3
@@ 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);

Do not follow this link