about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/stdio/pclose.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdio/pclose.c b/src/stdio/pclose.c
index c2fe7a24..7c777966 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;
 }