Changeset 3383 for trunk


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
  • trunk/libc/src/kNIX/os2/tcpipver.c

    r3382 r3383  
    946946    *pcFDs = iMax + 1;
    947947#else
    948     for (cbRet = sizeof(u_short), i = 0; i < c; i++)
     948    for (i = cbRet = 0; i < c; i++)
    949949        if (FD_ISSET(i, pFrom))
    950950            cbRet++;
    951     *pcFDs = c;
     951    if (*pcFDs < cbRet + 1)
     952        *pcFDs = cbRet + 1;
     953    cbRet *= sizeof(int);
     954    cbRet += offsetof(my_fd_set, fd_array);
    952955#endif
    953956    if (cbRet < sizeof(struct my_fd_set))
Note: See TracChangeset for help on using the changeset viewer.