From: Darren Tucker Date: Fri, 4 Jun 2021 13:41:29 +0000 (+1000) Subject: Clear notify_pipe from readset if present. X-Git-Tag: V_8_7_P1~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa99b2d9a3e45b943196914e8d8bf086646fdb54;p=thirdparty%2Fopenssh-portable.git Clear notify_pipe from readset if present. Prevents leaking an implementation detail to the caller. --- diff --git a/openbsd-compat/bsd-pselect.c b/openbsd-compat/bsd-pselect.c index 2cda0b587..da34b41d8 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*/