Changeset 3383 for branches


Ignore:
Timestamp:
Jun 10, 2007, 12:24:01 PM (18 years ago)
Author:
bird
Message:

Calculate the correct fd_set size and max handle count for the BSD44 version. Fixes #173.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/src/lib/sys/tcpipver.c

    r3382 r3383  
    933933    *pcFDs = iMax + 1;
    934934#else
    935     for (cbRet = sizeof(u_short), i = 0; i < c; i++)
     935    for (i = cbRet = 0; i < c; i++)
    936936        if (FD_ISSET(i, pFrom))
    937937            cbRet++;
    938     *pcFDs = c;
     938    if (*pcFDs < cbRet + 1)
     939        *pcFDs = cbRet + 1;
     940    cbRet *= sizeof(int);
     941    cbRet += offsetof(my_fd_set, fd_array);
    939942#endif
    940943    if (cbRet < sizeof(struct my_fd_set))
Note: See TracChangeset for help on using the changeset viewer.