David: Thanks for your help and time!<br><br>Norbert (openDBX author) just just tell me this is ok, but checking with PQisBusy() again shouldn&#39;t be necessary. So, it was simplified and commited to svn.<br><br>Actually now, it is like this:<br>

<br><pre>#ifdef HAVE_SELECT<br>        if( timeout != NULL &amp;&amp; PQisBusy( (PGconn*) handle-&gt;generic ) == 1 )<br>        {<br>                int fd, err;<br>                fd_set fds;<br><br>                if( ( fd = PQsocket( (PGconn*) handle-&gt;generic ) ) == -1 )<br>

                {<br>                        conn-&gt;errtype = -1;<br>                        return -ODBX_ERR_BACKEND;<br>                }<br><br>                FD_ZERO( &amp;fds );<br>                FD_SET( fd, &amp;fds );<br><br>                while( ( err = select( fd + 1, &amp;fds, NULL, NULL, timeout ) ) &lt; 0 &amp;&amp; errno == EINTR );<br>

<br>                switch( err )<br>                {<br>                        case -1:<br>                                return -ODBX_ERR_RESULT;<br>                        case 0:<br>                                return ODBX_RES_TIMEOUT;   /* timeout while waiting for a result */<br>                }<br>        }<br>#endif<br></pre>I test it and works like a charm.<br>
<br>thanks again.<br><br>
Mariano<br><br><div class="gmail_quote">On Wed, Jan 28, 2009 at 7:19 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Wed, Jan 28, 2009 at 12:51:04AM -0200, Mariano Martinez Peck wrote:<br>

&gt;<br>
&gt; So, what I change openDBX code from this:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if( ( fd = PQsocket( (PGconn*) handle-&gt;generic ) ) == -1 )<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conn-&gt;errtype = -1;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -ODBX_ERR_BACKEND;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; FD_ZERO( &amp;fds );<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; FD_SET( fd, &amp;fds );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; switch( select( fd + 1, &amp;fds, NULL, NULL, timeout ) )<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; to<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; do {<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( ( fd = PQsocket( (PGconn*) handle-&gt;generic ) ) == -1 )<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conn-&gt;errtype = -1;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -ODBX_ERR_BACKEND;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FD_ZERO( &amp;fds );<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FD_SET( fd, &amp;fds );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rv = select( fd + 1, &amp;fds, NULL, NULL, timeout );<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; } while ((rv == -1) &amp;&amp; (errno == EINTR));<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; switch( rv )<br>
&gt;<br>
&gt;<br>
&gt; And now It works perfect. It was difficult to reproduce because openDBX<br>
&gt; tests where ok, but squeakDBX ones not. This is because of SqueakVM as you<br>
&gt; explain me.<br>
<br>
</div>Your change looks right to me.<br>
<br>
Dave<br>
<br>
<br>
<br>
</blockquote></div><br>