summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authormonty@work.mysql.com <>2001-09-02 18:38:33 +0200
committermonty@work.mysql.com <>2001-09-02 18:38:33 +0200
commit447c18954e904e5770d64ae3b0817a16b9060b74 (patch)
tree4689ffbe50e97ce9a47deb58fa2b9e7decdfc6a8 /libmysql
parent102cabfe4acd9c78fe321829bd168342b3fbd68a (diff)
parent759cf54a9e70013d92fe18a84b3e4c56244de7da (diff)
downloadmariadb-git-447c18954e904e5770d64ae3b0817a16b9060b74.tar.gz
merge with 3.23.42
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/get_password.c7
-rw-r--r--libmysql/libmysql.c7
-rw-r--r--libmysql/net.c23
3 files changed, 20 insertions, 17 deletions
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index d61c40a9559..989de9dd11a 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -35,7 +35,7 @@
#include <pwd.h>
#endif /* HAVE_PWD_H */
#else /* ! HAVE_GETPASS */
-#ifndef __WIN__
+#if !defined( __WIN__) && !defined(OS2)
#include <sys/ioctl.h>
#ifdef HAVE_TERMIOS_H /* For tty-password */
#include <termios.h>
@@ -62,9 +62,8 @@
#define getpass(A) getpassphrase(A)
#endif
-#ifdef __WIN__
-/* were just going to fake it here and get input from
- the keyboard */
+#if defined( __WIN__) || defined(OS2)
+/* were just going to fake it here and get input from the keyboard */
char *get_tty_password(char *opt_message)
{
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index a59100903db..753bc1f7883 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -77,8 +77,7 @@ my_string mysql_unix_port=0;
#include <errno.h>
#define ERRNO errno
#define SOCKET_ERROR -1
-#define closesocket(A) close(A)
-#endif
+#endif /* __WIN__ */
static void mysql_once_init(void);
static MYSQL_DATA *read_rows (MYSQL *mysql,MYSQL_FIELD *fields,
@@ -149,7 +148,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
uint timeout)
{
-#if defined(__WIN__)
+#if defined(__WIN__) || defined(OS2)
return connect(s, (struct sockaddr*) name, namelen);
#else
int flags, res, s_err;
@@ -510,7 +509,7 @@ struct passwd *getpwuid(uid_t);
char* getlogin(void);
#endif
-#if !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__)
+#if !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2)
static void read_user_name(char *name)
{
DBUG_ENTER("read_user_name");
diff --git a/libmysql/net.c b/libmysql/net.c
index 0fc5cf8b50c..036a941ffae 100644
--- a/libmysql/net.c
+++ b/libmysql/net.c
@@ -40,7 +40,6 @@
#include <signal.h>
#include <errno.h>
#include <sys/types.h>
-#include <assert.h>
#ifdef MYSQL_SERVER
ulong max_allowed_packet=65536;
@@ -81,9 +80,15 @@ void sql_print_error(const char *format,...);
#define RETRY_COUNT mysqld_net_retry_count
extern ulong mysqld_net_retry_count;
#else
+
+#ifdef OS2 /* avoid name conflict */
+#define thr_alarm_t thr_alarm_t_net
+#define ALARM ALARM_net
+#endif
+
typedef my_bool thr_alarm_t;
typedef my_bool ALARM;
-#define thr_alarm_init(A) (*A)=0
+#define thr_alarm_init(A) (*(A))=0
#define thr_alarm_in_use(A) (*(A))
#define thr_end_alarm(A)
#define thr_alarm(A,B,C) local_thr_alarm((A),(B),(C))
@@ -134,7 +139,7 @@ int my_net_init(NET *net, Vio* vio)
if (vio != 0) /* If real connection */
{
net->fd = vio_fd(vio); /* For perl DBI/DBD */
-#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__)
+#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__) && !defined(OS2)
if (!(test_flags & TEST_BLOCKING))
vio_blocking(vio, FALSE);
#endif
@@ -336,7 +341,7 @@ net_real_write(NET *net,const char *packet,ulong len)
int length;
char *pos,*end;
thr_alarm_t alarmed;
-#if !defined(__WIN__)
+#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
ALARM alarm_buff;
#endif
uint retry_count=0;
@@ -394,7 +399,7 @@ net_real_write(NET *net,const char *packet,ulong len)
if ((int) (length=vio_write(net->vio,pos,(int) (end-pos))) <= 0)
{
my_bool interrupted = vio_should_retry(net->vio);
-#if (!defined(__WIN__) && !defined(__EMX__))
+#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2))
if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed))
{
if (!thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff))
@@ -491,8 +496,8 @@ static void my_net_skip_rest(NET *net, ulong remain, thr_alarm_t *alarmed)
if ((int) (length=vio_read(net->vio,(char*) net->buff,remain)) <= 0L)
{
my_bool interrupted = vio_should_retry(net->vio);
- if (!thr_got_alarm(&alarmed) && interrupted)
- { /* Probably in MIT threads */
+ if (!thr_got_alarm(alarmed) && interrupted)
+ { /* Probably in MIT threads */
if (retry_count++ < RETRY_COUNT)
continue;
}
@@ -519,7 +524,7 @@ my_real_read(NET *net, ulong *complen)
uint i,retry_count=0;
ulong len=packet_error;
thr_alarm_t alarmed;
-#if (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER)
+#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER)
ALARM alarm_buff;
#endif
my_bool net_blocking=vio_is_blocking(net->vio);
@@ -546,7 +551,7 @@ my_real_read(NET *net, ulong *complen)
DBUG_PRINT("info",("vio_read returned %d, errno: %d",
length, vio_errno(net->vio)));
-#if (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER)
+#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER)
/*
We got an error that there was no data on the socket. We now set up
an alarm to not 'read forever', change the socket to non blocking