ourerrno became Curl_ourerrno() and is now available to all libcurl

This commit is contained in:
Daniel Stenberg 2003-05-01 13:37:05 +00:00
parent f69ea2c68a
commit eb6130baa7
2 changed files with 7 additions and 6 deletions

View File

@ -81,8 +81,7 @@
#include "memdebug.h" #include "memdebug.h"
#endif #endif
static int Curl_ourerrno(void)
int ourerrno(void)
{ {
#ifdef WIN32 #ifdef WIN32
return (int)GetLastError(); return (int)GetLastError();
@ -350,7 +349,7 @@ int socketerror(int sockfd)
if( -1 == getsockopt(sockfd, SOL_SOCKET, SO_ERROR, if( -1 == getsockopt(sockfd, SOL_SOCKET, SO_ERROR,
(void *)&err, &errSize)) (void *)&err, &errSize))
err = ourerrno(); err = Curl_ourerrno();
return err; return err;
} }
@ -414,7 +413,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
return CURLE_COULDNT_CONNECT; return CURLE_COULDNT_CONNECT;
} }
else if(1 != rc) { else if(1 != rc) {
int error = ourerrno(); int error = Curl_ourerrno();
failf(data, "Failed connect to %s:%d, errno: %d", failf(data, "Failed connect to %s:%d, errno: %d",
conn->hostname, conn->port, error); conn->hostname, conn->port, error);
return CURLE_COULDNT_CONNECT; return CURLE_COULDNT_CONNECT;
@ -526,7 +525,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen); rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen);
if(-1 == rc) { if(-1 == rc) {
int error=ourerrno(); int error=Curl_ourerrno();
switch (error) { switch (error) {
case EINPROGRESS: case EINPROGRESS:
@ -645,7 +644,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
sizeof(serv_addr)); sizeof(serv_addr));
if(-1 == rc) { if(-1 == rc) {
int error=ourerrno(); int error=Curl_ourerrno();
switch (error) { switch (error) {
case EINPROGRESS: case EINPROGRESS:

View File

@ -37,4 +37,6 @@ CURLcode Curl_connecthost(struct connectdata *conn,
Curl_ipconnect **addr, /* the one we used */ Curl_ipconnect **addr, /* the one we used */
bool *connected /* truly connected? */ bool *connected /* truly connected? */
); );
int Curl_ourerrno(void);
#endif #endif