summaryrefslogtreecommitdiff
path: root/src/stdio/pclose.c
blob: 7c7779663e2dd6c191311e5e2cbf65340b00a7a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#include "stdio_impl.h"

int pclose(FILE *f)
{
	int status;
	pid_t pid = f->pipe_pid;
	fclose(f);
	while (waitpid(pid, &status, 0) == -1)
		if (errno != EINTR) return -1;
	return status;
}