From eed27593a41c2c85e8f202b7c1d06c155ce08cf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Mar 2003 16:45:39 -0500 Subject: Post-4.0.12 changes from Novell: mostly NetWare-related code changes to utilize new LibC client/mysql.cc: Remove unnecessary pthread_yield calls for NetWare client/mysqldump.c: Remove unnecessary pthread_yield calls for NetWare include/my_pthread.h: Special extern my_pthread_cond_timedwait no longer required for NetWare mysql-test/t/backup.test: replace_result added so test passes correctly on NetWare mysys/default.c: Add conditional to avoid non-applicable file checking on NetWare mysys/my_init.c: Remove working directory change from netware_init() mysys/my_pthread.c: Remove unnecessary NetWare version of my_pthread_cond_timedwait mysys/thr_mutex.c: Remove unnecessary NetWare block scripts/make_binary_distribution.sh: Changes to clear up extraneous EXTRA_BIN_FILES, NetWare sections --- mysys/default.c | 2 +- mysys/my_init.c | 14 ++------------ mysys/my_pthread.c | 13 ------------- mysys/thr_mutex.c | 5 ----- 4 files changed, 3 insertions(+), 31 deletions(-) (limited to 'mysys') diff --git a/mysys/default.c b/mysys/default.c index cfdda17fb5f..a3942425b7d 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -244,7 +244,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, strmov(name,config_file); } fn_format(name,name,"","",4); -#if !defined(__WIN__) && !defined(OS2) +#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) { MY_STAT stat_info; if (!my_stat(name,&stat_info,MYF(0))) diff --git a/mysys/my_init.c b/mysys/my_init.c index 61d9f4a4b2b..a8a184a2cb4 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -381,23 +381,13 @@ static void netware_init() { if (*name == '\\') { - *name = '/'; + *name = '/'; } else { - *name = tolower(*name); + *name = tolower(*name); } } - /* - Set the current working directory to the base directory of the file - name (assuming the binary is in 'base-file-name/bin/' - */ - strmov(cwd, my_progname); - if ((name= strindex(cwd, "/bin/")) != NULL) - { - *name= 0; - chdir(cwd); - } } } #endif /* __NETWARE__ */ diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 7ad4852558e..1eb15d92bc9 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -426,19 +426,6 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr) #endif -#ifdef __NETWARE__ -/* NetWare does not re-acquire the lock if the condition fails */ -int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - struct timespec *abstime) -{ - int err= pthread_cond_timedwait(cond, mutex, abstime); - if (err) - pthread_mutex_lock(mutex); - return err; -} -#endif /* __NETWARE__ */ - - /***************************************************************************** Patches for HPUX We need these because the pthread_mutex.. code returns -1 on error, diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index 2aabe2f500a..3abac2dc737 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -241,11 +241,6 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, fflush(stderr); abort(); } -#ifdef __NETWARE__ - /* NetWare doesn't re-acquire the mutex on an error */ - if (error && pthread_mutex_lock(&mp->mutex)) - mp->count--; -#endif /* __NETWARE__ */ mp->thread=pthread_self(); mp->file= (char*) file; mp->line=line; -- cgit v1.2.1 From cd30004b0da611f7a29f3e003d26cfd08473f268 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Apr 2003 13:07:42 +0300 Subject: Fixed bug in memory allocation that could affect 64 bit systems (affected hammer) mysys/my_vsnprintf.c: safety fix sql/log.cc: safety fix --- mysys/my_vsnprintf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mysys') diff --git a/mysys/my_vsnprintf.c b/mysys/my_vsnprintf.c index ab8edec4d7b..9bc33e28ba1 100644 --- a/mysys/my_vsnprintf.c +++ b/mysys/my_vsnprintf.c @@ -21,13 +21,18 @@ #include #include + int my_snprintf(char* to, size_t n, const char* fmt, ...) { + int result; va_list args; va_start(args,fmt); - return my_vsnprintf(to, n, fmt, args); + result= my_vsnprintf(to, n, fmt, args); + va_end(args); + return result; } + int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) { char *start=to, *end=to+n-1; @@ -79,6 +84,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) return (uint) (to - start); } + #ifdef MAIN static void my_printf(const char * fmt, ...) { @@ -92,6 +98,7 @@ static void my_printf(const char * fmt, ...) va_end(ar); } + int main() { -- cgit v1.2.1