diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2022-02-15 14:04:25 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 14:04:25 -0600 |
commit | a15cb1e20e165caf936319f9cdfb86f57effdfa6 (patch) | |
tree | 5ea202ad21bdaad559d785eb9c230bec09573975 | |
parent | bda7b311745d0fb515f345e47b5e54b04a77cfc9 (diff) | |
parent | ebfefa84bad5a930df4df85b150c27f1d4fe6de6 (diff) |
Merge pull request #160 from Humm42/closepipes
-s: close unused fds
-rw-r--r-- | dwl.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 */ |