cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: POSIX threaded DNS resolver - first experiences

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 24 Apr 2010 10:34:08 +0200 (CEST)

On Sat, 24 Apr 2010, Kamil Dudka wrote:

> You say there we need to "make sure that maxfd is bigger than -1". But in
> the code you intentionally do not in order to keep it working. What about
> updating all the comments like following?
>
> /* In a real-world program you OF COURSE check the return code of the function
> calls. On success, the value of maxfd is guaranteed to be greater or equal
> than than -1. We call select(maxfd + 1, ...), specially in case of
> (maxfd == -1), we call select(0, ...), which is basically equal to
> sleep. */

Yes I think that is a good idea. That seems like a better comment to use so
that it is made more obvious what happens in the -1 case.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-24