aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2022-02-15 14:04:25 -0600
committerGitHub <noreply@github.com>2022-02-15 14:04:25 -0600
commita15cb1e20e165caf936319f9cdfb86f57effdfa6 (patch)
tree5ea202ad21bdaad559d785eb9c230bec09573975
parentbda7b311745d0fb515f345e47b5e54b04a77cfc9 (diff)
parentebfefa84bad5a930df4df85b150c27f1d4fe6de6 (diff)
Merge pull request #160 from Humm42/closepipes
-s: close unused fds
-rw-r--r--dwl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 8683462..36a3871 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1827,11 +1827,13 @@ run(char *startup_cmd)
EBARF("startup: fork");
if (startup_pid == 0) {
dup2(piperw[0], STDIN_FILENO);
+ close(piperw[0]);
close(piperw[1]);
execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL);
EBARF("startup: execl");
}
dup2(piperw[1], STDOUT_FILENO);
+ close(piperw[1]);
close(piperw[0]);
}
/* If nobody is reading the status output, don't terminate */