[squeak-dev] Help needed with select() socket function and signalhandlers in squeakVM

David T. Lewis lewis at mail.msen.com
Wed Jan 28 21:19:59 UTC 2009


On Wed, Jan 28, 2009 at 12:51:04AM -0200, Mariano Martinez Peck wrote:
> 
> So, what I change openDBX code from this:
> 
>         if( ( fd = PQsocket( (PGconn*) handle->generic ) ) == -1 )
>         {
>             conn->errtype = -1;
>             return -ODBX_ERR_BACKEND;
>         }
> 
>         FD_ZERO( &fds );
>         FD_SET( fd, &fds );
> 
>         switch( select( fd + 1, &fds, NULL, NULL, timeout ) )
> 
> 
> 
> to
> 
> 
>     do {
> 
>             if( ( fd = PQsocket( (PGconn*) handle->generic ) ) == -1 )
>             {
>                 conn->errtype = -1;
>                 return -ODBX_ERR_BACKEND;
>             }
> 
>             FD_ZERO( &fds );
>             FD_SET( fd, &fds );
> 
>             rv = select( fd + 1, &fds, NULL, NULL, timeout );
> 
>         } while ((rv == -1) && (errno == EINTR));
> 
>         switch( rv )
> 
> 
> And now It works perfect. It was difficult to reproduce because openDBX
> tests where ok, but squeakDBX ones not. This is because of SqueakVM as you
> explain me.

Your change looks right to me.

Dave





More information about the Squeak-dev mailing list