[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in select() under Mingw32

From: René Berber
Subject: Bug in select() under Mingw32
Date: Mon, 14 Jun 2010 20:19:21 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20081209 Lightning/0.9 Thunderbird/ Mnenhy/


There's an error on the select() function:

rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
            struct timeval *timeout)
  static struct timeval tv0;
  static HANDLE hEvent;
  HANDLE h, handle_array[FD_SETSIZE + 2];
  fd_set handle_rfds, handle_wfds, handle_xfds;
  struct bitset rbits, wbits, xbits;
  unsigned char anyfds_in[FD_SETSIZE / CHAR_BIT];
  DWORD ret, wait_timeout, nhandles, nsock, nbuffer;
  MSG msg;
  int i, fd, rc;

  if (nfds > FD_SETSIZE)
    nfds = FD_SETSIZE;

  if (!timeout)
    wait_timeout = INFINITE;
      wait_timeout = timeout->tv_sec + timeout->tv_usec / 1000;

--- last line should be:

      wait_timeout = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;

René Berber

reply via email to

[Prev in Thread] Current Thread [Next in Thread]