diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-10-08 20:19:15 -0600 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-10-08 20:19:15 -0600 |
commit | 7740389944d15d553f6250da723ed5b68f9dcb0d (patch) | |
tree | 6a10c42ace6b5e578bf02b6b5f11be19c22a92ad /vio | |
parent | a64d1ddfcc7a1261b0b8bafcbf793c5a9ef9c91a (diff) | |
parent | 1c64f355b4e0bb7a709dd850857a9bb41b11d09c (diff) | |
download | mariadb-git-7740389944d15d553f6250da723ed5b68f9dcb0d.tar.gz |
Merge work:/home/bk/mysql-4.0
into mysql.sashanet.com:/home/sasha/src/bk/mysql-4.0
mysql-test/r/drop.result:
Auto merged
mysql-test/r/err000001.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/overflow.result:
Auto merged
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio.c | 28 | ||||
-rw-r--r-- | vio/viosocket.c | 39 | ||||
-rw-r--r-- | vio/viossl.c | 38 |
3 files changed, 14 insertions, 91 deletions
diff --git a/vio/vio.c b/vio/vio.c index 15a12bb958d..759f9416ddf 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -25,38 +25,10 @@ #include <my_global.h> #include <mysql_com.h> #include <violite.h> - #include <errno.h> -#include <assert.h> #include <my_sys.h> #include <my_net.h> #include <m_string.h> -#ifdef HAVE_POLL -#include <sys/poll.h> -#endif -#ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif - -#if defined(__EMX__) -#define ioctlsocket ioctl -#endif /* defined(__EMX__) */ - -#if defined(MSDOS) || defined(__WIN__) -#ifdef __WIN__ -#undef errno -#undef EINTR -#undef EAGAIN -#define errno WSAGetLastError() -#define EINTR WSAEINTR -#define EAGAIN WSAEINPROGRESS -#endif /* __WIN__ */ -#define O_NONBLOCK 1 /* For emulation of fcntl() */ -#endif -#ifndef EWOULDBLOCK -#define EWOULDBLOCK EAGAIN -#endif - /* * Helper to fill most of the Vio* with defaults. diff --git a/vio/viosocket.c b/vio/viosocket.c index 60272db3171..f6f62924b00 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -27,36 +27,10 @@ #include <mysql_com.h> #include <errno.h> -#include <assert.h> #include <violite.h> #include <my_sys.h> #include <my_net.h> #include <m_string.h> -#ifdef HAVE_POLL -#include <sys/poll.h> -#endif -#ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif - -#if defined(__EMX__) -#define ioctlsocket ioctl -#endif /* defined(__EMX__) */ - -#if defined(MSDOS) || defined(__WIN__) -#ifdef __WIN__ -#undef errno -#undef EINTR -#undef EAGAIN -#define errno WSAGetLastError() -#define EINTR WSAEINTR -#define EAGAIN WSAEINPROGRESS -#endif /* __WIN__ */ -#define O_NONBLOCK 1 /* For emulation of fcntl() */ -#endif -#ifndef EWOULDBLOCK -#define EWOULDBLOCK EAGAIN -#endif #ifndef __WIN__ #define HANDLE void * @@ -76,7 +50,7 @@ void vio_delete(Vio* vio) int vio_errno(Vio *vio __attribute__((unused))) { - return errno; /* On Win32 this mapped to WSAGetLastError() */ + return socket_errno; /* On Win32 this mapped to WSAGetLastError() */ } @@ -129,7 +103,7 @@ int vio_write(Vio * vio, const gptr buf, int size) #ifndef DBUG_OFF if (r < 0) { - DBUG_PRINT("vio_error", ("Got error on write: %d",errno)); + DBUG_PRINT("vio_error", ("Got error on write: %d",socket_errno)); } #endif /* DBUG_OFF */ DBUG_PRINT("exit", ("%d", r)); @@ -242,8 +216,9 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) my_bool vio_should_retry(Vio * vio __attribute__((unused))) { - int en = errno; - return en == EAGAIN || en == EINTR || en == EWOULDBLOCK; + int en = socket_errno; + return (en == SOCKET_EAGAIN || en == SOCKET_EINTR || + en == SOCKET_EWOULDBLOCK); } @@ -271,7 +246,7 @@ int vio_close(Vio * vio) } if (r) { - DBUG_PRINT("vio_error", ("close() failed, error: %d",errno)); + DBUG_PRINT("vio_error", ("close() failed, error: %d",socket_errno)); /* FIXME: error handling (not critical for MySQL) */ } vio->type= VIO_CLOSED; @@ -310,7 +285,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf) if (getpeername(vio->sd, (struct sockaddr *) (& (vio->remote)), &addrLen) != 0) { - DBUG_PRINT("exit", ("getpeername, error: %d", errno)); + DBUG_PRINT("exit", ("getpeername, error: %d", socket_errno)); DBUG_RETURN(1); } my_inet_ntoa(vio->remote.sin_addr,buf); diff --git a/vio/viossl.c b/vio/viossl.c index e80dc0ce807..e4f2d0a5c9f 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -34,31 +34,6 @@ #include <my_sys.h> #include <my_net.h> #include <m_string.h> -#ifdef HAVE_POLL -#include <sys/poll.h> -#endif -#ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif - -#if defined(__EMX__) -#define ioctlsocket ioctl -#endif /* defined(__EMX__) */ - -#if defined(MSDOS) || defined(__WIN__) -#ifdef __WIN__ -#undef errno -#undef EINTR -#undef EAGAIN -#define errno WSAGetLastError() -#define EINTR WSAEINTR -#define EAGAIN WSAEINPROGRESS -#endif /* __WIN__ */ -#define O_NONBLOCK 1 /* For emulation of fcntl() */ -#endif -#ifndef EWOULDBLOCK -#define EWOULDBLOCK EAGAIN -#endif #ifndef __WIN__ #define HANDLE void * @@ -83,7 +58,7 @@ report_errors() if (!any_ssl_error) { DBUG_PRINT("info", ("No OpenSSL errors.")); } - DBUG_PRINT("info", ("BTW, errno=%d", errno)); + DBUG_PRINT("info", ("BTW, errno=%d", scoket_errno)); DBUG_VOID_RETURN; } @@ -102,7 +77,7 @@ void vio_ssl_delete(Vio * vio) int vio_ssl_errno(Vio *vio __attribute__((unused))) { - return errno; /* On Win32 this mapped to WSAGetLastError() */ + return socket_errno; /* On Win32 this mapped to WSAGetLastError() */ } @@ -195,8 +170,9 @@ int vio_ssl_keepalive(Vio* vio, my_bool set_keep_alive) my_bool vio_ssl_should_retry(Vio * vio __attribute__((unused))) { - int en = errno; - return en == EAGAIN || en == EINTR || en == EWOULDBLOCK; + int en = socket_errno; + return (en == SOCKET_EAGAIN || en == SOCKET_EINTR || + en == SOCKET_EWOULDBLOCK); } @@ -217,7 +193,7 @@ int vio_ssl_close(Vio * vio) r= -1; if (r) { - DBUG_PRINT("error", ("close() failed, error: %d",errno)); + DBUG_PRINT("error", ("close() failed, error: %d",socket_errno)); report_errors(); /* FIXME: error handling (not critical for MySQL) */ } @@ -257,7 +233,7 @@ my_bool vio_ssl_peer_addr(Vio * vio, char *buf) if (getpeername(vio->sd, (struct sockaddr *) (& (vio->remote)), &addrLen) != 0) { - DBUG_PRINT("exit", ("getpeername, error: %d", errno)); + DBUG_PRINT("exit", ("getpeername, error: %d", socket_errno)); DBUG_RETURN(1); } /* FIXME */ |