diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 08:16:06 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 08:16:06 -0300 |
commit | b3d22cef93306849f7eaeba2907bcd1099f9e33f (patch) | |
tree | 5f9985f179d0e43f7caa8e99eaf627865f967ba0 /libmysql | |
parent | f54a1182494db9bababccfa83692630bec51ca95 (diff) | |
download | mariadb-git-b3d22cef93306849f7eaeba2907bcd1099f9e33f.tar.gz |
WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/dll.c | 20 | ||||
-rw-r--r-- | libmysql/libmysql.c | 46 |
2 files changed, 23 insertions, 43 deletions
diff --git a/libmysql/dll.c b/libmysql/dll.c index 8fcf41c792c..b5fcba13f91 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -48,7 +48,7 @@ void libmysql_init(void) #ifdef __WIN__ static int inited=0,threads=0; -HINSTANCE NEAR s_hModule; /* Saved module handle */ +HINSTANCE s_hModule; /* Saved module handle */ DWORD main_thread; BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called, @@ -105,21 +105,3 @@ int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserve return TRUE; } -#elif defined(WINDOWS) - -/**************************************************************************** -** This routine is called by LIBSTART.ASM at module load time. All it -** does in this sample is remember the DLL module handle. The module -** handle is needed if you want to do things like load stuff from the -** resource file (for instance string resources). -****************************************************************************/ - -int _export FAR PASCAL libmain(HANDLE hModule,short cbHeapSize, - UCHAR FAR *lszCmdLine) -{ - s_hModule = hModule; - libmysql_init(); - return TRUE; -} - -#endif diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 68813937fb6..7af9c5a6525 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -34,7 +34,7 @@ #ifdef HAVE_PWD_H #include <pwd.h> #endif -#if !defined(MSDOS) && !defined(__WIN__) +#if !defined(__WIN__) #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -45,7 +45,7 @@ #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif -#endif /* !defined(MSDOS) && !defined(__WIN__) */ +#endif /* !defined(__WIN__) */ #ifdef HAVE_POLL #include <sys/poll.h> #endif @@ -74,7 +74,7 @@ ulong max_allowed_packet= 1024L*1024L*1024L; my_bool net_flush(NET *net); #endif -#if defined(MSDOS) || defined(__WIN__) +#if defined(__WIN__) /* socket_errno is defined in my_global.h for all platforms */ #define perror(A) #else @@ -128,31 +128,29 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), init_client_errs(); if (!mysql_port) { + char *env; + struct servent *serv_ptr __attribute__((unused)); + mysql_port = MYSQL_PORT; -#ifndef MSDOS - { - struct servent *serv_ptr __attribute__((unused)); - char *env; - /* - if builder specifically requested a default port, use that - (even if it coincides with our factory default). - only if they didn't do we check /etc/services (and, failing - on that, fall back to the factory default of 3306). - either default can be overridden by the environment variable - MYSQL_TCP_PORT, which in turn can be overridden with command - line options. - */ + /* + if builder specifically requested a default port, use that + (even if it coincides with our factory default). + only if they didn't do we check /etc/services (and, failing + on that, fall back to the factory default of 3306). + either default can be overridden by the environment variable + MYSQL_TCP_PORT, which in turn can be overridden with command + line options. + */ #if MYSQL_PORT_DEFAULT == 0 - if ((serv_ptr = getservbyname("mysql", "tcp"))) - mysql_port = (uint) ntohs((ushort) serv_ptr->s_port); -#endif - if ((env = getenv("MYSQL_TCP_PORT"))) - mysql_port =(uint) atoi(env); - } + if ((serv_ptr= getservbyname("mysql", "tcp"))) + mysql_port= (uint) ntohs((ushort) serv_ptr->s_port); #endif + if ((env= getenv("MYSQL_TCP_PORT"))) + mysql_port=(uint) atoi(env); } + if (!mysql_unix_port) { char *env; @@ -479,7 +477,7 @@ struct passwd *getpwuid(uid_t); char* getlogin(void); #endif -#if !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) +#if !defined(VMS) && !defined(__WIN__) void read_user_name(char *name) { @@ -509,7 +507,7 @@ void read_user_name(char *name) DBUG_VOID_RETURN; } -#else /* If MSDOS || VMS */ +#else /* If Windows || VMS */ void read_user_name(char *name) { |