diff --git a/qrexec/qrexec-daemon.c b/qrexec/qrexec-daemon.c index 964ffff..6df3ebf 100644 --- a/qrexec/qrexec-daemon.c +++ b/qrexec/qrexec-daemon.c @@ -608,8 +608,6 @@ static void reap_children() pid_t pid; while ((pid=waitpid(-1, &status, WNOHANG)) > 0) { - /* FIXME: perhaps keep max(policy_pending) somewhere to optimize this - * search */ for (i = 0; i <= policy_pending_max; i++) { if (policy_pending[i].pid == pid) { status = WEXITSTATUS(status); @@ -620,7 +618,7 @@ static void reap_children() * MSG_SERVICE_CONNECT from client handler */ policy_pending[i].pid = 0; while (policy_pending_max > 0 && - policy_pending[policy_pending_max].pid > 0) + policy_pending[policy_pending_max].pid == 0) policy_pending_max--; break; }