Bug Hunter wrote:
> we opened a pipe without error. we then did this:
> FD_ZERO(&InputFD); // initialize read descriptors
>
> FD_SET(s,&InputFD); // Add socket to descriptors to
> FD_SET(FromDH,&InputFD); // wait on Modem data as well
>
> FD_ZERO(&wErrorFD);
> FD_SET(s,&wErrorFD);
> FD_SET(FromDH, &wErrorFD);
>
> signal(SIGALRM,SignalHandler);
>
> while(1){
> wInputFD = InputFD;
> // don't wait more than 500msec before reporting
> timeout.tv_sec = 0;
> timeout.tv_usec = 500000;
> short result = select(FD_SETSIZE,&wInputFD,NULL,&wErrorFD,&timeout);
> ...
>
>
> We get a 2 from select, then the pipe (FromDH) indicates
> an error. errno is zero. There is no error that we can
> see. any clues?
What do you mean that the pipe `indicates an error'?
Note that the third fd_set (fourth argument to select) indicates
`exceptional conditions', not necessarily errors.
Also, errno is only set if some library function indicates an error
(usually by returning -1, NULL, etc). If select() returns 2, then it
won't have set errno.
--
Glynn Clements <[EMAIL PROTECTED]>