I noticed that if socket descriptor is -1, the server main loop will
consume 100% CPU, since select/poll will never be called. That is a bug, so
might as well assert that sd!=-1.


On Fri, Dec 6, 2013 at 1:02 PM, Edward Welbourne
<notifications@github.com>wrote:

> In cf-serverd/cf-serverd-functions.c:
>
> > @@ -322,10 +320,8 @@ void StartServer(EvalContext *ctx, Policy **policy, GenericAgentConfig *config)
> >          return;
> >      }
> >
> > -    if (sd != -1)
> > -    {
> > -        Log(LOG_LEVEL_VERBOSE, "Listening for connections ...");
> > -    }
> > +    assert(sd != -1);
>
> Why are you so sure ?
> In any case, this assertion should appear immediately after the call to
> SetServerListenState().
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/cfengine/core/pull/1169/files#r8159395>
> .
>