1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.


Docs/manual.texi:
  Updated upgrading from 3.23 -> 4.0
client/mysqladmin.c:
  Portability fixes
client/mysqlshow.c:
  Portability fixes
extra/resolveip.c:
  Portability fixes
include/my_global.h:
  Portability fixes
include/my_net.h:
  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.
include/mysql_com.h:
  Portability fixes
libmysql/net.c:
  Portability fixes
libmysqld/lib_vio.c:
  Portability fixes
mysql-test/r/drop.result:
  Fix crashed tests
mysql-test/r/err000001.result:
  Fix crashed tests
mysql-test/r/innodb.result:
  Fix crashed tests
mysql-test/r/overflow.result:
  Fix crashed tests
sql/net_serv.cc:
  Use new my_net.h
vio/vio.c:
  Use new my_net.h
vio/viosocket.c:
  Use new my_net.h
vio/viossl.c:
  Use new my_net.h
This commit is contained in:
unknown
2001-10-09 03:35:29 +03:00
parent 9417dc5c17
commit 1c64f355b4
17 changed files with 87 additions and 160 deletions

View File

@ -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 */