==== //projects/shared/curl-7.12.0.1/akamai/curl/include/curl/curl.h#2 - /Users/lcampbel/Akamai/build/akamai/curl/include/curl/curl.h ====
@@ -1123,9 +1123,10 @@
   CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,
   CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,
   CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
+  CURLINFO_OS_ERRNO	    = CURLINFO_LONG   + 25,
   /* Fill in new entries below here! */
 
-  CURLINFO_LASTONE          = 23
+  CURLINFO_LASTONE          = 25
 } CURLINFO;
 
 /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
==== //projects/shared/curl-7.12.0.1/akamai/curl/lib/connect.c#2 - /Users/lcampbel/Akamai/build/akamai/curl/lib/connect.c ====
@@ -370,7 +370,8 @@
         }
 #endif
         if(!bindworked) {
-          failf(data, "%s", Curl_strerror(conn, Curl_ourerrno()));
+	  data->state.os_errno = Curl_ourerrno();
+          failf(data, "%s", Curl_strerror(conn, data->state.os_errno));
           return CURLE_HTTP_PORT_FAILED;
         }
 	
@@ -491,17 +492,20 @@
   rc = waitconnect(sockfd, 0);
 
   if(0 == rc) {
-    if (verifyconnect(sockfd,NULL)) {
+    int error;
+    if (verifyconnect(sockfd,&error)) {
       /* we are connected, awesome! */
       *connected = TRUE;
       return CURLE_OK;
     }
     /* nope, not connected for real */
+    data->state.os_errno = error;
     failf(data, "Connection failed");
     return CURLE_COULDNT_CONNECT;
   }
   else if(1 != rc) {
     int error = Curl_ourerrno();
+    data->state.os_errno = error;
     failf(data, "Failed connect to %s:%d; %s",
           conn->host.name, conn->port, Curl_strerror(conn,error));
     return CURLE_COULDNT_CONNECT;
@@ -668,6 +672,7 @@
 
     if(-1 == rc) {
       error = Curl_ourerrno();
+      data->state.os_errno = error;
 
       switch (error) {
       case EINPROGRESS:
==== //projects/shared/curl-7.12.0.1/akamai/curl/lib/getinfo.c#2 - /Users/lcampbel/Akamai/build/akamai/curl/lib/getinfo.c ====
@@ -167,6 +167,9 @@
   case CURLINFO_PROXYAUTH_AVAIL:
     *param_longp = data->info.proxyauthavail;
     break;
+  case CURLINFO_OS_ERRNO:
+    *param_longp = data->state.os_errno;
+    break;
   default:
     return CURLE_BAD_FUNCTION_ARGUMENT;
   }
==== //projects/shared/curl-7.12.0.1/akamai/curl/lib/transfer.c#2 - /Users/lcampbel/Akamai/build/akamai/curl/lib/transfer.c ====
@@ -1512,6 +1512,7 @@
   data->set.followlocation=0; /* reset the location-follow counter */
   data->state.this_is_a_follow = FALSE; /* reset this */
   data->state.errorbuf = FALSE; /* no error has occurred */
+  data->state.os_errno = 0;
 
   data->state.authproblem = FALSE;
   data->state.authhost.want = data->set.httpauth;
==== //projects/shared/curl-7.12.0.1/akamai/curl/lib/urldata.h#2 - /Users/lcampbel/Akamai/build/akamai/curl/lib/urldata.h ====
@@ -731,6 +731,7 @@
   bool errorbuf; /* Set to TRUE if the error buffer is already filled in.
                     This must be set to FALSE every time _easy_perform() is
                     called. */
+  int os_errno;	 /* filled in from errno whenever an error occurs */
 
 #ifdef HAVE_SIGNAL
   /* storage for the previous bag^H^H^HSIGPIPE signal handler :-) */

