summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-pselect.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2021-06-04 23:41:29 +1000
committerDarren Tucker <dtucker@dtucker.net>2021-06-04 23:41:29 +1000
commitaa99b2d9a3e45b943196914e8d8bf086646fdb54 (patch)
treed3329105751f76dbde51fb64332ab12ff95ad352 /openbsd-compat/bsd-pselect.c
parent6de8dadf6b4d0627d35bca0667ca44b1d61c2c6b (diff)
downloadopenssh-git-aa99b2d9a3e45b943196914e8d8bf086646fdb54.tar.gz
Clear notify_pipe from readset if present.
Prevents leaking an implementation detail to the caller.
Diffstat (limited to 'openbsd-compat/bsd-pselect.c')
-rw-r--r--openbsd-compat/bsd-pselect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-pselect.c b/openbsd-compat/bsd-pselect.c
index 2cda0b58..da34b41d 100644
--- a/openbsd-compat/bsd-pselect.c
+++ b/openbsd-compat/bsd-pselect.c
@@ -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*/