On Wed, 30 Jan 2002, Gilles Detillieux wrote:

> > aix 4.2
> > tru64 5.0a (where it is an alias for EWOULDBLOCK)
> > freebsd 4.0 (where EWOULDBLOCK is an alias for it)
> > hpux 10.20
> > irix 6.5 (where EWOULDBLOCK is an alias for it)
>   NeXTSTEP 2.1 (old Mach/BSD based system)
>   QNX 4.23 (POSIX-compliant RTOS - EWOULDBLOCK is an alias for it)
>   SunOS 5.8 (where EWOULDBLOCK is an alias for it)
>   Linux 2.0.36 (where EWOULDBLOCK is an alias for it) - also 2.2.14 & 2.4.9

Well, I had already confirmed Solaris 2.8 and Mac OS X, so it seems it's
relatively portable.

> > #ifdef EAGAIN
> > <my patch>
> > #endif

Yes, I think this is a good idea at this point for 3.1.6 and we can get
rid of the #ifdef for 3.2.0b4 testing.

So here's my suggestion for adapting the patch to the current
code. #ifndef EAGAIN will run the current code exactly. Otherwise, add a
check for EAGAIN to decide if we break and fail. It seems like the
smallest amount of change to the current 3.1.6 code.

        status = ::connect(sock, (struct sockaddr *)&server, sizeof(server));
        //
        // Disable alarm and restore previous policy if any
        //
        alarm(0);
        sigaction(SIGALRM, &old_action, 0);

        if (status == 0 || errno == EALREADY || errno == EISCONN)
          {
            connected = 1;
            return OK;
          }

        //
        // Only loop if timed out. Other errors are fatal.
        //
        #ifndef EAGAIN
        if (status < 0 && errno != EINTR)
          break;
        #else
        if (status < 0 && errno != EINTR && errno != EAGAIN)
          break;
        #endif

        ::close(sock);
        open();
        sleep(wait_time);
      }

--
-Geoff Hutchison
Williams Students Online
http://wso.williams.edu/


_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to