summaryrefslogtreecommitdiff
path: root/vio/viossl.c
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-10-09 03:35:29 +0300
committermonty@hundin.mysql.fi <>2001-10-09 03:35:29 +0300
commitd5fe1db868a8786bad901a632631c2d94eadfbe6 (patch)
tree07f2a0acc005ba2b7fb714ce60cb6f8417c6f60e /vio/viossl.c
parent196f620e9024b12e33125c4be03c867b0fabbfcc (diff)
downloadmariadb-git-d5fe1db868a8786bad901a632631c2d94eadfbe6.tar.gz
One should not only have to include my_net.h to work with sockets.
This wrapper noew will include all the necessary, system specific files, which makes all normal source files much easier to write and maintain. Portability fixes.
Diffstat (limited to 'vio/viossl.c')
-rw-r--r--vio/viossl.c38
1 files changed, 7 insertions, 31 deletions
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 */