s3 async: Fix the build on systems that have ETIMEDOUT but not ETIME
authorTim Prouty <tprouty@samba.org>
Mon, 9 Feb 2009 17:36:40 +0000 (09:36 -0800)
committerTim Prouty <tprouty@samba.org>
Mon, 9 Feb 2009 21:23:44 +0000 (13:23 -0800)
Fallback on EAGAIN

lib/async_req/async_sock.c
source3/lib/util_sock.c

index 46ad29d053473ce952b19dd7800b4f6ac1e17bef..02ae88068380406366af07c4f6f665f668e31a73 100644 (file)
@@ -116,10 +116,10 @@ bool async_req_is_errno(struct async_req *req, int *err)
                *err = (int)error;
                break;
        case ASYNC_REQ_TIMED_OUT:
-#ifdef HAVE_ETIMEDOUT
+#ifdef ETIMEDOUT
                *err = ETIMEDOUT;
 #else
-               *err = EIO;
+               *err = EAGAIN;
 #endif
                break;
        case ASYNC_REQ_NO_MEMORY:
index b9a7f8788d3c9cc072b4680ef0ecea69282f2588..c46aa2ac49b75c7b43f5fd66416473a894b2853f 100644 (file)
@@ -1061,10 +1061,13 @@ static void open_socket_out_connected(struct async_req *subreq)
                return;
        }
 
-       if ((sys_errno == ETIME)
-           || (sys_errno == EINPROGRESS)
-           || (sys_errno == EALREADY)
-           || (sys_errno == EAGAIN)) {
+       if (
+#ifdef ETIMEDOUT
+               (sys_errno == ETIMEDOUT) ||
+#endif
+               (sys_errno == EINPROGRESS) ||
+               (sys_errno == EALREADY) ||
+               (sys_errno == EAGAIN)) {
 
                /*
                 * retry