Clear notify_pipe from readset if present.

Prevents leaking an implementation detail to the caller.
This commit is contained in:
Darren Tucker 2021-06-04 23:41:29 +10:00
parent 6de8dadf6b
commit aa99b2d9a3
1 changed files with 3 additions and 1 deletions

View File

@ -114,9 +114,11 @@ notify_done(fd_set *readset)
{
char c;
if (notify_pipe[0] != -1 && FD_ISSET(notify_pipe[0], readset))
if (notify_pipe[0] != -1 && FD_ISSET(notify_pipe[0], readset)) {
while (read(notify_pipe[0], &c, 1) != -1)
debug2_f("reading");
FD_CLR(notify_pipe[0], readset);
}
}
/*ARGSUSED*/