On 1/2/07, seventh guardian <[EMAIL PROTECTED]> wrote:
On 1/1/07, Dominik Vogt <[EMAIL PROTECTED]> wrote:
> On Mon, Jan 01, 2007 at 02:41:24PM -0600, fvwm-workers wrote:
> > CVSROOT:      /home/cvs/fvwm
> > Module name:  fvwm
> > Changes by:   renato  07/01/01 14:41:24
> >
> > Modified files:
> >       .              : ChangeLog
> >       fvwm           : module_interface.c
> >       libs           : defaults.h
> >
> > Log message:
> > *Removed the test for MAX_NUM_MODULES - let the O.S. do the checks
>
> Nonono, you can't do that.  The OS does not check number of fds an
> fdset can have.  If you allow infinite modules, the set might
> overflow with unpredictable results.  (Actually it might even
> overflow with the limit if fvwm is started from a process with
> lots of open fds).

I see.. never thought about that..

But then it's a problem of too many fd's, and not too many modules. So
the check should be to see if the fd's being added to the set are
smaller than FD_SETSIZE. This way it will work all the time..

I'll see what I can do..

I think I've found a solution that has some added benefits:

Currently there are only two places in the code where modules see
their pipes added to fdsets, and that is in My_XNextEvent and in
CMD_Module_Synchronous. It happens that this addition is done with
exactly the same code, so it's a matter of creating a function with
this code and add the check.

An advantage is that it hides the module structure from this part of
events.c and concentrates similar code in one location.

Cheers
   Renato

Reply via email to