Hi,
there's a problem in command.c. First you should not
do FD_ISSET if select() returned -1. The critical
problem is (it's not your fault) that FD_SETSIZE
and syconf(_SC_OPEN_MAX) may tell you different values.
Unfortunately (at least with NetBSD) FD_ZERO, FD_SET,
FD_ISSET are macros which use the constant value of
FD_SETSIZE. This means if the admin/user has set the
max. open-file-limit to a value above FD_SETSIZE
FD_ZERO does not clear any bits above FD_SETSIZE and
select() may return -1 with errno=EBADF because the
value of bits above FD_SETSIZE is undeterminated.
Regards,
Christian
command.c.patch
Logged In: YES
user_id=51181
aterm doesn't use num_fds in the select loop any longer.