diff --git a/src/stdio/pclose.c b/src/stdio/pclose.c index c2fe7a24a85107e95e58c8aa947524156dcca6b6..7c7779663e2dd6c191311e5e2cbf65340b00a7a9 100644 --- a/src/stdio/pclose.c +++ b/src/stdio/pclose.c @@ -3,8 +3,9 @@ int pclose(FILE *f) { int status; + pid_t pid = f->pipe_pid; fclose(f); - while (waitpid(f->pipe_pid, &status, 0) == -1) + while (waitpid(pid, &status, 0) == -1) if (errno != EINTR) return -1; return status; }