]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Clear notify_pipe from readset if present.
authorDarren Tucker <dtucker@dtucker.net>
Fri, 4 Jun 2021 13:41:29 +0000 (23:41 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 4 Jun 2021 13:41:29 +0000 (23:41 +1000)
Prevents leaking an implementation detail to the caller.

openbsd-compat/bsd-pselect.c

index 2cda0b5873199a4a89d4543ea72fe1606553d819..da34b41d8b69f93d2ff25886a6b1a7570867c002 100644 (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*/