diff --git a/lib/roken/detach.c b/lib/roken/detach.c index 2b8bc924c..f0499f1d2 100644 --- a/lib/roken/detach.c +++ b/lib/roken/detach.c @@ -129,6 +129,8 @@ roken_detach_prep(int argc, char **argv, char *special_arg) do { bytes = read(pipefds[0], buf, sizeof(buf)); } while (bytes == -1 && errno == EINTR); + (void) close(pipefds[0]); + pipefds[0] = -1; if (bytes == -1) { /* * No need to wait for the process. We've killed it. If it