Skip to content

Commit 24968f1

Browse files
author
greg@mysql.com
committed
Changes from Novell for NetWare platform
1 parent 80a3c64 commit 24968f1

File tree

7 files changed

+36
-11
lines changed

7 files changed

+36
-11
lines changed

include/my_pthread.h

+5
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ extern int my_sigwait(const sigset_t *set,int *sig);
247247
#error Requires at least rev 2 of EMX pthreads library.
248248
#endif
249249

250+
#ifdef __NETWARE__
251+
void my_pthread_exit(void *status);
252+
#define pthread_exit(A) my_pthread_exit(A)
253+
#endif
254+
250255
extern int my_pthread_getprio(pthread_t thread_id);
251256

252257
#define pthread_key(T,V) pthread_key_t V

mysys/mf_path.c

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ my_string my_path(my_string to, const char *progname,
7777
#define F_OK 0
7878
#define PATH_SEP ';'
7979
#define PROGRAM_EXTENSION ".exe"
80+
#elif defined(__NETWARE__)
81+
#define PATH_SEP ';'
82+
#define PROGRAM_EXTENSION ".nlm"
8083
#else
8184
#define PATH_SEP ':'
8285
#endif

mysys/my_pthread.c

+23
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,29 @@ void *my_pthread_getspecific_imp(pthread_key_t key)
9090
}
9191
#endif
9292

93+
#ifdef __NETWARE__
94+
/*
95+
don't kill the LibC Reaper thread or the main thread
96+
*/
97+
#include <nks/thread.h>
98+
void my_pthread_exit(void *status)
99+
{
100+
#undef pthread_exit
101+
NXThreadId_t tid = NXThreadGetId();
102+
NXContext_t ctx;
103+
char name[PATH_MAX] = "";
104+
105+
NXThreadGetContext(tid, &ctx);
106+
NXContextGetName(ctx, name, PATH_MAX);
107+
108+
// "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
109+
// with a debug build of LibC the reaper can have different names
110+
if (!strindex(name, "\'s"))
111+
{
112+
pthread_exit(status);
113+
}
114+
}
115+
#endif
93116

94117
/* Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7
95118
(and DEC OSF/1 3.2 too) */

sql/mini_client.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static void mc_free_old_query(MYSQL *mysql)
243243
static int mc_sock_connect(my_socket s, const struct sockaddr *name,
244244
uint namelen, uint to)
245245
{
246-
#if defined(__WIN__) || defined(OS2)
246+
#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__)
247247
return connect(s, (struct sockaddr*) name, namelen);
248248
#else
249249
int flags, res, s_err;

sql/mysqld.cc

+3-5
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,9 @@ static void __cdecl kill_server(int sig_ptr)
797797

798798
#ifdef __NETWARE__
799799
pthread_join(select_thread, NULL); // wait for main thread
800-
#else
801-
pthread_exit(0); /* purecov: deadcode */
802800
#endif /* __NETWARE__ */
801+
802+
pthread_exit(0); /* purecov: deadcode */
803803

804804
RETURN_FROM_KILL_SERVER;
805805
}
@@ -856,13 +856,11 @@ void unireg_end(void)
856856
{
857857
clean_up(1);
858858
my_thread_end();
859-
#ifndef __NETWARE__
860-
#ifdef SIGNALS_DONT_BREAK_READ
859+
#if defined(SIGNALS_DONT_BREAK_READ) && !defined(__NETWARE__)
861860
exit(0);
862861
#else
863862
pthread_exit(0); // Exit is in main thread
864863
#endif
865-
#endif /* __NETWARE__ */
866864
}
867865

868866

sql/slave.cc

-4
Original file line numberDiff line numberDiff line change
@@ -2355,9 +2355,7 @@ log space");
23552355
goto slave_begin;
23562356
#endif
23572357
my_thread_end();
2358-
#ifndef __NETWARE__
23592358
pthread_exit(0);
2360-
#endif /* __NETWARE__ */
23612359
DBUG_RETURN(0); // Can't return anything here
23622360
}
23632361

@@ -2500,9 +2498,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
25002498
goto slave_begin;
25012499
#endif
25022500
my_thread_end(); // clean-up before broadcasting termination
2503-
#ifndef __NETWARE__
25042501
pthread_exit(0);
2505-
#endif /* __NETWARE__ */
25062502
DBUG_RETURN(0); // Can't return anything here
25072503
}
25082504

sql/sql_load.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
179179
else
180180
{
181181
unpack_filename(name,ex->file_name);
182-
#if !defined(__WIN__) && !defined(OS2)
182+
#if !defined(__WIN__) && !defined(OS2) && ! defined(__NETWARE__)
183183
MY_STAT stat_info;
184184
if (!my_stat(name,&stat_info,MYF(MY_WME)))
185185
DBUG_RETURN(-1);

0 commit comments

Comments
 (0)