From 5d1d27c0165c151fd73163fa7d9bce353d6f9687 Mon Sep 17 00:00:00 2001 From: "brian@zim.(none)" <> Date: Sat, 15 Apr 2006 18:17:32 -0700 Subject: [PATCH] Final patch to remove the last of the OS2 support. --- client/client_priv.h | 2 - client/mysql.cc | 50 +++---------- dbug/dbug.c | 2 +- include/m_string.h | 6 +- include/my_global.h | 1 - libmysql/dll.c | 23 ------ libmysql/get_password.c | 4 +- libmysql/libmysql.c | 2 +- libmysql/manager.c | 4 +- sql-common/client.c | 13 +--- sql/event_executor.cc | 2 +- sql/hostname.cc | 2 +- sql/log.cc | 4 - sql/log_event.h | 4 - sql/my_lock.c | 2 +- sql/mysql_priv.h | 6 +- sql/mysqld.cc | 114 +++-------------------------- sql/net_serv.cc | 10 +-- sql/repl_failsafe.cc | 2 +- sql/slave.cc | 2 +- sql/sql_base.cc | 4 +- sql/sql_insert.cc | 4 +- sql/sql_load.cc | 4 +- sql/sql_parse.cc | 12 +-- sql/sql_table.cc | 12 +-- storage/myisam/myisamchk.c | 4 - storage/ndb/src/mgmclient/main.cpp | 2 +- storage/ndb/src/mgmsrv/main.cpp | 2 +- vio/vio.c | 4 +- vio/viosocket.c | 14 ++-- vio/viossl.c | 4 +- 31 files changed, 65 insertions(+), 256 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index a80701ba6c9..625fbf24fa6 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -24,8 +24,6 @@ #include #include -/* We have to define 'enum options' identical in all files to keep OS2 happy */ - enum options_client { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, diff --git a/client/mysql.cc b/client/mysql.cc index e45ad9ac006..af349d9c5be 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -81,7 +81,7 @@ extern "C" { #endif #undef bcmp // Fix problem with new readline -#if defined( __WIN__) || defined(OS2) +#if defined( __WIN__) #include #elif !defined(__NETWARE__) #include @@ -101,7 +101,7 @@ extern "C" { #define cmp_database(cs,A,B) strcmp((A),(B)) #endif -#if !defined( __WIN__) && !defined( OS2) && !defined(__NETWARE__) && (!defined(HAVE_mit_thread) || !defined(THREAD)) +#if !defined( __WIN__) && !defined(__NETWARE__) && !defined(THREAD) #define USE_POPEN #endif @@ -969,7 +969,7 @@ static int get_options(int argc, char **argv) static int read_and_execute(bool interactive) { -#if defined(OS2) || defined(__NETWARE__) +#if defined(__NETWARE__) char linebuffer[254]; String buffer; #endif @@ -1006,7 +1006,7 @@ static int read_and_execute(bool interactive) if (opt_outfile && glob_buffer.is_empty()) fflush(OUTFILE); -#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined( __WIN__) || defined(__NETWARE__) tee_fputs(prompt, stdout); #if defined(__NETWARE__) line=fgets(linebuffer, sizeof(linebuffer)-1, stdin); @@ -1017,7 +1017,7 @@ static int read_and_execute(bool interactive) if (p != NULL) *p = '\0'; } -#elif defined(__WIN__) +#else defined(__WIN__) if (!tmpbuf.is_alloced()) tmpbuf.alloc(65535); tmpbuf.length(0); @@ -1033,32 +1033,12 @@ static int read_and_execute(bool interactive) */ } while (tmpbuf.alloced_length() <= clen); line= buffer.c_ptr(); -#else /* OS2 */ - buffer.length(0); - /* _cgets() expects the buffer size - 3 as the first byte */ - linebuffer[0]= (char) sizeof(linebuffer) - 3; - do - { - line= _cgets(linebuffer); - buffer.append(line, (unsigned char)linebuffer[1]); - /* - If _cgets() gets an input line that is linebuffer[0] bytes - long, the next call to _cgets() will return immediately with - linebuffer[1] == 0, and it does the same thing for input that - is linebuffer[0]-1 bytes long. So it appears that even though - _cgets() replaces the newline (which is two bytes on Window) with - a nil, it still needs the space in the linebuffer for it. This is, - naturally, undocumented. - */ - } while ((unsigned char)linebuffer[0] <= - (unsigned char)linebuffer[1] + 1); - line= buffer.c_ptr(); #endif /* __NETWARE__ */ #else if (opt_outfile) fputs(prompt, OUTFILE); line= readline(prompt); -#endif /* defined( __WIN__) || defined(OS2) || defined(__NETWARE__) */ +#endif /* defined( __WIN__) || defined(__NETWARE__) */ /* When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS @@ -1110,7 +1090,7 @@ static int read_and_execute(bool interactive) } } -#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined( __WIN__) || defined(__NETWARE__) buffer.free(); #endif #if defined( __WIN__) @@ -3429,9 +3409,6 @@ void tee_fprintf(FILE *file, const char *fmt, ...) NETWARE_YIELD; va_start(args, fmt); (void) vfprintf(file, fmt, args); -#ifdef OS2 - fflush( file); -#endif va_end(args); if (opt_outfile) @@ -3447,9 +3424,6 @@ void tee_fputs(const char *s, FILE *file) { NETWARE_YIELD; fputs(s, file); -#ifdef OS2 - fflush( file); -#endif if (opt_outfile) fputs(s, OUTFILE); } @@ -3460,9 +3434,6 @@ void tee_puts(const char *s, FILE *file) NETWARE_YIELD; fputs(s, file); fputs("\n", file); -#ifdef OS2 - fflush( file); -#endif if (opt_outfile) { fputs(s, OUTFILE); @@ -3473,14 +3444,11 @@ void tee_puts(const char *s, FILE *file) void tee_putc(int c, FILE *file) { putc(c, file); -#ifdef OS2 - fflush( file); -#endif if (opt_outfile) putc(c, OUTFILE); } -#if defined( __WIN__) || defined( OS2) || defined(__NETWARE__) +#if defined( __WIN__) || defined(__NETWARE__) #include #else #include @@ -3492,7 +3460,7 @@ void tee_putc(int c, FILE *file) static ulong start_timer(void) { -#if defined( __WIN__) || defined( OS2) || defined(__NETWARE__) +#if defined( __WIN__) || defined(__NETWARE__) return clock(); #else struct tms tms_tmp; diff --git a/dbug/dbug.c b/dbug/dbug.c index dc5b06a63e2..52de4b4a92d 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -2215,7 +2215,7 @@ static unsigned long Clock() return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000; } -#elif defined(MSDOS) || defined(__WIN__) || defined(OS2) +#elif defined(MSDOS) || defined(__WIN__) static ulong Clock() { diff --git a/include/m_string.h b/include/m_string.h index c580e38e177..d7086555b1e 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -52,7 +52,7 @@ #endif /* This is needed for the definitions of bzero... on solaris */ -#if defined(HAVE_STRINGS_H) && !defined(HAVE_mit_thread) +#if defined(HAVE_STRINGS_H) #include #endif @@ -95,7 +95,7 @@ extern "C" { extern void *(*my_str_malloc)(size_t); extern void (*my_str_free)(void *); -#if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread) +#if defined(HAVE_STPCPY) #define strmov(A,B) stpcpy((A),(B)) #ifndef stpcpy extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ @@ -243,7 +243,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error); #ifdef HAVE_LONG_LONG extern char *longlong2str(longlong val,char *dst,int radix); extern char *longlong10_to_str(longlong val,char *dst,int radix); -#if (!defined(HAVE_STRTOULL) || defined(HAVE_mit_thread)) || defined(NO_STRTOLL_PROTO) +#if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO) extern longlong strtoll(const char *str, char **ptr, int base); extern ulonglong strtoull(const char *str, char **ptr, int base); #endif diff --git a/include/my_global.h b/include/my_global.h index 500481fd6b8..42a93fb5e63 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -206,7 +206,6 @@ /* The client defines this to avoid all thread code */ #if defined(UNDEF_THREADS_HACK) #undef THREAD -#undef HAVE_mit_thread #undef HAVE_LINUXTHREADS #undef HAVE_NPTL #undef HAVE_UNIXWARE7_THREADS diff --git a/libmysql/dll.c b/libmysql/dll.c index b0e4b9cab3b..f5db0bb4669 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -112,26 +112,3 @@ int _export FAR PASCAL libmain(HANDLE hModule,short cbHeapSize, } #endif - -#ifdef OS2 - -/* - This function is called automatically by _DLL_InitTerm - Every dll runtime enviroment is not tz enabled, so tzset() - must be called to enable TZ handling - Also timezone is fixed. -*/ - -extern "C" unsigned long _System DllMain(unsigned long modhandle, - unsigned long flag) -{ - if (flag == 0) { - tzset(); /* Set tzname */ - time_t currentTime = time(NULL); - struct tm *ts = localtime(¤tTime); - if (ts->tm_isdst > 0) - _timezone -= 3600; - } -} - -#endif diff --git a/libmysql/get_password.c b/libmysql/get_password.c index e55e77320f0..a48cb6d7a6e 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -36,7 +36,7 @@ #include #endif /* HAVE_PWD_H */ #else /* ! HAVE_GETPASS */ -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) #include #ifdef HAVE_TERMIOS_H /* For tty-password */ #include @@ -65,7 +65,7 @@ #define getpass(A) getpassphrase(A) #endif -#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined( __WIN__) || defined(__NETWARE__) /* were just going to fake it here and get input from the keyboard */ #ifdef __NETWARE__ diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 3406d606692..b750e9cc4b2 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -739,7 +739,7 @@ void read_user_name(char *name) strmake(name, str ? str : "UNKNOWN_USER", USERNAME_LENGTH); } -#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2) +#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) void read_user_name(char *name) { diff --git a/libmysql/manager.c b/libmysql/manager.c index 631bfa26cb2..a88c63123b0 100644 --- a/libmysql/manager.c +++ b/libmysql/manager.c @@ -35,9 +35,7 @@ #include #include -#if defined(OS2) -# include -#elif defined(__NETWARE__) +#if defined(__NETWARE__) #include #include #include diff --git a/sql-common/client.c b/sql-common/client.c index 72745d72b12..32672ce1201 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -71,11 +71,6 @@ my_bool net_flush(NET *net); #include /* because of signal() */ #endif /* defined(THREAD) && !defined(__WIN__) */ -#if defined(OS2) && defined(MYSQL_SERVER) -#undef ER -#define ER CER -#endif /* defined( OS2) && defined(MYSQL_SERVER) */ - #include #include #include @@ -126,7 +121,7 @@ const char *def_shared_memory_base_name= default_shared_memory_base_name; static void mysql_close_free_options(MYSQL *mysql); static void mysql_close_free(MYSQL *mysql); -#if !(defined(__WIN__) || defined(OS2) || defined(__NETWARE__)) +#if !(defined(__WIN__) || defined(__NETWARE__)) static int wait_for_data(my_socket fd, uint timeout); #endif @@ -143,7 +138,7 @@ static int wait_for_data(my_socket fd, uint timeout); int my_connect(my_socket fd, const struct sockaddr *name, uint namelen, uint timeout) { -#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined(__WIN__) || defined(__NETWARE__) return connect(fd, (struct sockaddr*) name, namelen); #else int flags, res, s_err; @@ -183,7 +178,7 @@ int my_connect(my_socket fd, const struct sockaddr *name, uint namelen, If not, we will use select() */ -#if !(defined(__WIN__) || defined(OS2) || defined(__NETWARE__)) +#if !(defined(__WIN__) || defined(__NETWARE__)) static int wait_for_data(my_socket fd, uint timeout) { @@ -274,7 +269,7 @@ static int wait_for_data(my_socket fd, uint timeout) return (0); /* ok */ #endif /* HAVE_POLL */ } -#endif /* defined(__WIN__) || defined(OS2) || defined(__NETWARE__) */ +#endif /* defined(__WIN__) || defined(__NETWARE__) */ /* diff --git a/sql/event_executor.cc b/sql/event_executor.cc index 498760bb6fd..21464dd777b 100644 --- a/sql/event_executor.cc +++ b/sql/event_executor.cc @@ -291,7 +291,7 @@ init_event_thread(THD* thd) DBUG_RETURN(-1); } -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); diff --git a/sql/hostname.cc b/sql/hostname.cc index c5c337080cf..52c4107372f 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -26,7 +26,7 @@ #ifdef __cplusplus extern "C" { // Because of SCO 3.2V4.2 #endif -#if !defined( __WIN__) && !defined(OS2) +#if !defined( __WIN__) #ifdef HAVE_SYS_UN_H #include #endif diff --git a/sql/log.cc b/sql/log.cc index 5c67443d238..3f6e3108a0b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -18,10 +18,6 @@ /* logging of commands */ /* TODO: Abort logging when we get an error in reading or writing log files */ -#ifdef __EMX__ -#include -#endif - #include "mysql_priv.h" #include "sql_repl.h" #include "rpl_filter.h" diff --git a/sql/log_event.h b/sql/log_event.h index d6ce354fbdf..b24686514e3 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -18,10 +18,6 @@ #ifndef _log_event_h #define _log_event_h -#ifdef __EMX__ -#undef write // remove pthread.h macro definition, conflict with write() class member -#endif - #if defined(USE_PRAGMA_INTERFACE) && !defined(MYSQL_CLIENT) #pragma interface /* gcc class implementation */ #endif diff --git a/sql/my_lock.c b/sql/my_lock.c index 7f47256703a..69884df22f8 100644 --- a/sql/my_lock.c +++ b/sql/my_lock.c @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if defined(__EMX__) || defined(__NETWARE__) +#if defined(__NETWARE__) #include "../mysys/my_lock.c" #else diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index ac7957d41f1..c471b11fee2 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -36,10 +36,6 @@ #include "sql_bitmap.h" #include "sql_array.h" -#ifdef __EMX__ -#undef write /* remove pthread.h macro definition for EMX */ -#endif - /* TODO convert all these three maps to Bitmap classes */ typedef ulonglong table_map; /* Used for table bits in join */ #if MAX_INDEXES <= 64 @@ -206,7 +202,7 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; #define IF_NETWARE(A,B) (B) #endif -#if defined(__WIN__) || defined(OS2) +#if defined(__WIN__) #define IF_WIN(A,B) (A) #undef FLUSH_TIME #define FLUSH_TIME 1800 /* Flush every half hour */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 71067630535..33c16eb245a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -95,9 +95,7 @@ extern "C" { // Because of SCO 3.2V4.2 #endif #include -#if defined(OS2) -# include -#elif !defined(__WIN__) +#if !defined(__WIN__) # ifndef __NETWARE__ #include # endif /* __NETWARE__ */ @@ -648,10 +646,6 @@ static SECURITY_DESCRIPTOR sdPipeDescriptor; static HANDLE hPipe = INVALID_HANDLE_VALUE; #endif -#ifdef OS2 -pthread_cond_t eventShutdown; -#endif - #ifndef EMBEDDED_LIBRARY bool mysqld_embedded=0; #else @@ -751,7 +745,7 @@ static void close_connections(void) (void) pthread_mutex_unlock(&LOCK_manager); /* kill connection thread */ -#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) DBUG_PRINT("quit",("waiting for select thread: 0x%lx",select_thread)); (void) pthread_mutex_lock(&LOCK_thread_count); @@ -980,8 +974,6 @@ void kill_mysql(void) */ } #endif -#elif defined(OS2) - pthread_cond_signal(&eventShutdown); // post semaphore #elif defined(HAVE_PTHREAD_KILL) if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL)) { @@ -1007,7 +999,7 @@ void kill_mysql(void) /* Force server down. kill all connections and threads and exit */ -#if defined(OS2) || defined(__NETWARE__) +#if defined(__NETWARE__) extern "C" void kill_server(int sig_ptr) #define RETURN_FROM_KILL_SERVER DBUG_VOID_RETURN #elif !defined(__WIN__) @@ -1044,7 +1036,7 @@ static void __cdecl kill_server(int sig_ptr) } #endif -#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2)) +#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__)) my_thread_init(); // If this is a new thread #endif close_connections(); @@ -1082,7 +1074,7 @@ extern "C" sig_handler print_signal_warning(int sig) #ifdef DONT_REMEMBER_SIGNAL my_sigset(sig,print_signal_warning); /* int. thread system calls */ #endif -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) if (sig == SIGALRM) alarm(2); /* reschedule alarm */ #endif @@ -1336,7 +1328,7 @@ static void set_ports() static struct passwd *check_user(const char *user) { -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) struct passwd *user_info; uid_t user_id= geteuid(); @@ -1390,7 +1382,7 @@ err: static void set_user(const char *user, struct passwd *user_info) { -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) DBUG_ASSERT(user_info != 0); #ifdef HAVE_INITGROUPS /* @@ -1419,7 +1411,7 @@ static void set_user(const char *user, struct passwd *user_info) static void set_effective_user(struct passwd *user_info) { -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) DBUG_ASSERT(user_info != 0); if (setregid((gid_t)-1, user_info->pw_gid) == -1) { @@ -1439,7 +1431,7 @@ static void set_effective_user(struct passwd *user_info) static void set_root(const char *path) { -#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) if (chroot(path) == -1) { sql_perror("chroot"); @@ -1786,7 +1778,7 @@ extern "C" sig_handler abort_thread(int sig __attribute__((unused))) the signal thread is ready before continuing ******************************************************************************/ -#if defined(__WIN__) || defined(OS2) +#if defined(__WIN__) static void init_signals(void) { int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT } ; @@ -2046,44 +2038,7 @@ static void check_data_home(const char *path) { } -#elif defined(__EMX__) -static void sig_reload(int signo) -{ - // Flush everything - bool not_used; - reload_acl_and_cache((THD*) 0,REFRESH_LOG, (TABLE_LIST*) 0, ¬_used); - signal(signo, SIG_ACK); -} - -static void sig_kill(int signo) -{ - if (!kill_in_progress) - { - abort_loop=1; // mark abort for threads - kill_server((void*) signo); - } - signal(signo, SIG_ACK); -} - -static void init_signals(void) -{ - signal(SIGQUIT, sig_kill); - signal(SIGKILL, sig_kill); - signal(SIGTERM, sig_kill); - signal(SIGINT, sig_kill); - signal(SIGHUP, sig_reload); // Flush everything - signal(SIGALRM, SIG_IGN); - signal(SIGBREAK,SIG_IGN); - signal_thread = pthread_self(); -} - -static void start_signal_handler(void) -{} - -static void check_data_home(const char *path) -{} - -#else /* if ! __WIN__ && ! __EMX__ */ +#else /* if ! __WIN__ */ #ifdef HAVE_LINUXTHREADS #define UNSAFE_DEFAULT_LINUX_THREADS 200 @@ -2556,33 +2511,6 @@ int STDCALL handle_kill(ulong ctrl_type) } #endif - -#ifdef OS2 -pthread_handler_t handle_shutdown(void *arg) -{ - my_thread_init(); - - // wait semaphore - pthread_cond_wait(&eventShutdown, NULL); - - // close semaphore and kill server - pthread_cond_destroy(&eventShutdown); - - /* - Exit main loop on main thread, so kill will be done from - main thread (this is thread 2) - */ - abort_loop = 1; - - // unblock select() - so_cancel(ip_sock); - so_cancel(unix_sock); - - return 0; -} -#endif - - static const char *load_default_groups[]= { #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE "mysql_cluster", @@ -2650,14 +2578,6 @@ static int init_common_variables(const char *conf_file_name, int argc, return 1; mysql_init_variables(); -#ifdef OS2 - { - // fix timezone for daylight saving - struct tm *ts = localtime(&start_time); - if (ts->tm_isdst > 0) - _timezone -= 3600; - } -#endif #ifdef HAVE_TZNAME { struct tm tm_tmp; @@ -3360,12 +3280,6 @@ static void create_shutdown_thread() // On "Stop Service" we have to do regular shutdown Service.SetShutdownEvent(hEventShutdown); #endif -#ifdef OS2 - pthread_cond_init(&eventShutdown, NULL); - pthread_t hThread; - if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0)) - sql_print_warning("Can't create thread to handle shutdown requests"); -#endif #endif // EMBEDDED_LIBRARY } @@ -4292,10 +4206,6 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused))) create_new_thread(thd); } -#ifdef OS2 - // kill server must be invoked from thread 1! - kill_server(MYSQL_KILL_SIGNAL); -#endif decrement_handler_count(); DBUG_RETURN(0); } @@ -5666,7 +5576,7 @@ log and this option does nothing anymore.", 0, 0, 0, 0, 0}, {"tmpdir", 't', "Path for temporary files. Several paths may be specified, separated by a " -#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined(__WIN__) || defined(__NETWARE__) "semicolon (;)" #else "colon (:)" diff --git a/sql/net_serv.cc b/sql/net_serv.cc index c80bb8bad9a..9713e4bed44 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -135,7 +135,7 @@ my_bool 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__) && !defined(OS2) +#if defined(MYSQL_SERVER) && !defined(__WIN__) if (!(test_flags & TEST_BLOCKING)) { my_bool old_mode; @@ -604,7 +604,7 @@ net_real_write(NET *net,const char *packet,ulong len) if ((long) (length=vio_write(net->vio,pos,(uint32) (end-pos))) <= 0) { my_bool interrupted = vio_should_retry(net->vio); -#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) +#if !defined(__WIN__) if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed)) { if (!thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff)) @@ -631,7 +631,7 @@ net_real_write(NET *net,const char *packet,ulong len) } } else -#endif /* (!defined(__WIN__) && !defined(__EMX__)) */ +#endif /* !defined(__WIN__) */ if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) && interrupted) { @@ -803,7 +803,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(OS2)) || defined(MYSQL_SERVER) +#if !defined(__WIN__) || 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 @@ -839,7 +839,7 @@ my_real_read(NET *net, ulong *complen) continue; } } -#endif /* (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER) */ +#endif /* (!defined(__WIN__) || defined(MYSQL_SERVER) */ if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) && interrupted) { /* Probably in MIT threads */ diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 34dcd80a236..e207a0bf633 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -83,7 +83,7 @@ static int init_failsafe_rpl_thread(THD* thd) DBUG_RETURN(-1); } -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); diff --git a/sql/slave.cc b/sql/slave.cc index 04ecc04ab17..4ab9e951813 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2601,7 +2601,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) DBUG_RETURN(-1); } -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 7499cec6147..e09fed180ba 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3000,13 +3000,13 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type) if (table) { -#if defined( __WIN__) || defined(OS2) +#if defined( __WIN__) /* Win32 can't drop a file that is open */ if (lock_type == TL_WRITE_ALLOW_READ) { lock_type= TL_WRITE; } -#endif /* __WIN__ || OS2 */ +#endif /* __WIN__ */ table_list->lock_type= lock_type; table_list->table= table; table->grant= table_list->grant; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 0aef574b3e4..946c0536897 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1713,7 +1713,7 @@ pthread_handler_t handle_delayed_insert(void *arg) since it does not find one in the list. */ pthread_mutex_lock(&di->mutex); -#if !defined( __WIN__) && !defined(OS2) /* Win32 calls this in pthread_create */ +#if !defined( __WIN__) /* Win32 calls this in pthread_create */ if (my_thread_init()) { strmov(thd->net.last_error,ER(thd->net.last_errno=ER_OUT_OF_RESOURCES)); @@ -1729,7 +1729,7 @@ pthread_handler_t handle_delayed_insert(void *arg) strmov(thd->net.last_error,ER(thd->net.last_errno=ER_OUT_OF_RESOURCES)); goto err; } -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 599480e616c..bf8a6b8cfbe 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -294,7 +294,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, { (void) fn_format(name, ex->file_name, mysql_real_data_home, "", MY_RELATIVE_PATH | MY_UNPACK_FILENAME); -#if !defined(__WIN__) && !defined(OS2) && ! defined(__NETWARE__) +#if !defined(__WIN__) && ! defined(__NETWARE__) MY_STAT stat_info; if (!my_stat(name,&stat_info,MYF(MY_WME))) DBUG_RETURN(TRUE); @@ -302,9 +302,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, // if we are not in slave thread, the file must be: if (!thd->slave_thread && !((stat_info.st_mode & S_IROTH) == S_IROTH && // readable by others -#ifndef __EMX__ (stat_info.st_mode & S_IFLNK) != S_IFLNK && // and not a symlink -#endif ((stat_info.st_mode & S_IFREG) == S_IFREG || (stat_info.st_mode & S_IFIFO) == S_IFIFO))) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ee0120092a2..c63a5c23d60 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -118,10 +118,6 @@ static void test_signal(int sig_ptr) #if !defined( DBUG_OFF) MessageBox(NULL,"Test signal","DBUG",MB_OK); #endif -#if defined(OS2) - fprintf(stderr, "Test signal %d\n", sig_ptr); - fflush(stderr); -#endif } static void init_signals(void) { @@ -1092,7 +1088,7 @@ pthread_handler_t handle_one_connection(void *arg) pthread_detach_this_thread(); -#if !defined( __WIN__) && !defined(OS2) // Win32 calls this in pthread_create +#if !defined( __WIN__) // Win32 calls this in pthread_create /* The following calls needs to be done before we call DBUG_ macros */ if (!(test_flags & TEST_NO_THREADS) & my_thread_init()) { @@ -1116,7 +1112,7 @@ pthread_handler_t handle_one_connection(void *arg) #if defined(__WIN__) init_signals(); -#elif !defined(OS2) && !defined(__NETWARE__) +#elif !defined(__NETWARE__) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); @@ -1240,7 +1236,7 @@ pthread_handler_t handle_bootstrap(void *arg) #ifndef EMBEDDED_LIBRARY pthread_detach_this_thread(); thd->thread_stack= (char*) &thd; -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) sigset_t set; VOID(sigemptyset(&set)); // Get mask in use VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); @@ -1969,9 +1965,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #ifdef __WIN__ sleep(1); // must wait after eof() #endif -#ifndef OS2 send_eof(thd); // This is for 'quit request' -#endif close_connection(thd, 0, 1); close_thread_tables(thd); // Free before kill kill_mysql(); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0c08c960785..1d84c4b0f4a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3625,11 +3625,7 @@ err: bool mysql_analyze_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt) { -#ifdef OS2 - thr_lock_type lock_type = TL_WRITE; -#else thr_lock_type lock_type = TL_READ_NO_INSERT; -#endif DBUG_ENTER("mysql_analyze_table"); DBUG_RETURN(mysql_admin_table(thd, tables, check_opt, @@ -3640,11 +3636,7 @@ bool mysql_analyze_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt) bool mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt) { -#ifdef OS2 - thr_lock_type lock_type = TL_WRITE; -#else thr_lock_type lock_type = TL_READ_NO_INSERT; -#endif DBUG_ENTER("mysql_check_table"); DBUG_RETURN(mysql_admin_table(thd, tables, check_opt, @@ -4998,7 +4990,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, } } -#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2)) +#if !defined( __WIN__) if (table->file->has_transactions()) #endif { @@ -5011,7 +5003,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, table=0; // Marker that table is closed no_table_reopen= TRUE; } -#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2)) +#if !defined( __WIN__) else table->file->extra(HA_EXTRA_FORCE_REOPEN); // Don't use this file anymore #endif diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 46f7558bc6a..7fcfb8fc65a 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -88,10 +88,6 @@ int main(int argc, char **argv) MY_INIT(argv[0]); my_progname_short= my_progname+dirname_length(my_progname); -#ifdef __EMX__ - _wildcard (&argc, &argv); -#endif - myisamchk_init(&check_param); check_param.opt_lock_memory=1; /* Lock memory if possible */ check_param.using_global_keycache = 0; diff --git a/storage/ndb/src/mgmclient/main.cpp b/storage/ndb/src/mgmclient/main.cpp index ba5d0308f1f..73a18f98c9d 100644 --- a/storage/ndb/src/mgmclient/main.cpp +++ b/storage/ndb/src/mgmclient/main.cpp @@ -19,7 +19,7 @@ // copied from mysql.cc to get readline extern "C" { -#if defined( __WIN__) || defined(OS2) +#if defined( __WIN__) #include #elif !defined(__NETWARE__) #include diff --git a/storage/ndb/src/mgmsrv/main.cpp b/storage/ndb/src/mgmsrv/main.cpp index 5960a3517b5..26cb0951d3a 100644 --- a/storage/ndb/src/mgmsrv/main.cpp +++ b/storage/ndb/src/mgmsrv/main.cpp @@ -50,7 +50,7 @@ const char progname[] = "mgmtsrvr"; // copied from mysql.cc to get readline extern "C" { -#if defined( __WIN__) || defined(OS2) +#if defined( __WIN__) #include #elif !defined(__NETWARE__) #include diff --git a/vio/vio.c b/vio/vio.c index bc286b2d2bb..9ace22e3780 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -147,7 +147,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags) sprintf(vio->desc, (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), vio->sd); -#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) +#if !defined(__WIN__) #if !defined(NO_FCNTL_NONBLOCK) /* We call fcntl() to set the flags and then immediately read them back @@ -166,7 +166,7 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags) (void) ioctl(sd,FIOSNBIO,0); vio->fcntl_mode &= ~O_NONBLOCK; #endif -#else /* !defined(__WIN__) && !defined(__EMX__) */ +#else /* !defined(__WIN__) */ { /* set to blocking mode by default */ ulong arg=0, r; diff --git a/vio/viosocket.c b/vio/viosocket.c index 710f7a93607..0ddceb72e91 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -128,7 +128,7 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode, DBUG_PRINT("enter", ("set_blocking_mode: %d old_mode: %d", (int) set_blocking_mode, (int) *old_mode)); -#if !defined(__WIN__) && !defined(__EMX__) +#if !defined(__WIN__) #if !defined(NO_FCNTL_NONBLOCK) if (vio->sd >= 0) { @@ -150,10 +150,8 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode, #else r= set_blocking_mode ? 0 : 1; #endif /* !defined(NO_FCNTL_NONBLOCK) */ -#else /* !defined(__WIN__) && !defined(__EMX__) */ -#ifndef __EMX__ +#else /* !defined(__WIN__) */ if (vio->type != VIO_TYPE_NAMEDPIPE && vio->type != VIO_TYPE_SHARED_MEMORY) -#endif { ulong arg; int old_fcntl=vio->fcntl_mode; @@ -170,11 +168,9 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode, if (old_fcntl != vio->fcntl_mode) r = ioctlsocket(vio->sd,FIONBIO,(void*) &arg); } -#ifndef __EMX__ else r= test(!(vio->fcntl_mode & O_NONBLOCK)) != set_blocking_mode; -#endif /* __EMX__ */ -#endif /* !defined(__WIN__) && !defined(__EMX__) */ +#endif /* !defined(__WIN__) */ DBUG_PRINT("exit", ("%d", r)); DBUG_RETURN(r); } @@ -195,12 +191,12 @@ int vio_fastsend(Vio * vio __attribute__((unused))) int r=0; DBUG_ENTER("vio_fastsend"); -#if defined(IPTOS_THROUGHPUT) && !defined(__EMX__) +#if defined(IPTOS_THROUGHPUT) { int tos = IPTOS_THROUGHPUT; r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos)); } -#endif /* IPTOS_THROUGHPUT && !__EMX__ */ +#endif /* IPTOS_THROUGHPUT */ if (!r) { #ifdef __WIN__ diff --git a/vio/viossl.c b/vio/viossl.c index 1273814c551..a0262a79209 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -112,12 +112,12 @@ int vio_ssl_fastsend(Vio * vio __attribute__((unused))) int r=0; DBUG_ENTER("vio_ssl_fastsend"); -#if defined(IPTOS_THROUGHPUT) && !defined(__EMX__) +#if defined(IPTOS_THROUGHPUT) { int tos= IPTOS_THROUGHPUT; r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos)); } -#endif /* IPTOS_THROUGHPUT && !__EMX__ */ +#endif /* IPTOS_THROUGHPUT */ if (!r) { #ifdef __WIN__