summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-20 04:59:34 +0300
committerunknown <monty@donna.mysql.com>2000-09-20 04:59:34 +0300
commit5993b4947b23e4aca2dfc7b7f92b30f14e56c04f (patch)
tree47e17b2858b02fa9f69cb087e6add8a937bbd62f /mysys
parent96b2e908528a5532eb89468569a6db302182d37c (diff)
parent5a2419eb89d2f617e94ebef64ffbef72417ec94c (diff)
downloadmariadb-git-5993b4947b23e4aca2dfc7b7f92b30f14e56c04f.tar.gz
merge
mysys/mf_format.c: Auto merged sql/ha_myisam.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_table.cc: Auto merged
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_format.c3
-rw-r--r--mysys/my_wincond.c1
-rw-r--r--mysys/thr_mutex.c16
3 files changed, 18 insertions, 2 deletions
diff --git a/mysys/mf_format.c b/mysys/mf_format.c
index aa4d469e20c..63e1b3cb1ba 100644
--- a/mysys/mf_format.c
+++ b/mysys/mf_format.c
@@ -96,13 +96,14 @@ my_string fn_format(my_string to, const char *name, const char *dsk,
bmove(buff,(char*) name,length); /* Save name for last copy */
name=buff;
}
- (void) strmov(strnmov(strmov(to,dev),name,length),ext);
+ pos=strnmov(strmov(to,dev),name,length);
#ifdef FN_UPPER_CASE
caseup_str(to);
#endif
#ifdef FN_LOWER_CASE
casedn_str(to);
#endif
+ (void) strmov(pos,ext); /* Don't convert extension */
}
/* Purify gives a lot of UMR errors when using realpath */
#if defined(HAVE_REALPATH) && !defined(HAVE_purify)
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index 3643d0ec0a6..0c5b01f90d8 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -19,6 +19,7 @@
** The following is a simple implementation of posix conditions
*****************************************************************************/
+#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#include "mysys_priv.h"
#if defined(THREAD) && defined(__WIN__)
#include <m_string.h>
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 9b9c7a8e407..9d9c3a1ce08 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -107,12 +107,17 @@ int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line)
abort();
}
mp->count--;
+#ifdef __WIN__
+ pthread_mutex_unlock(&mp->mutex);
+ error=0;
+#else
error=pthread_mutex_unlock(&mp->mutex);
if (error)
{
fprintf(stderr,"safe_mutex: Got error: %d when trying to unlock mutex at %s, line %d\n", error, file, line);
abort();
}
+#endif /* __WIN__ */
pthread_mutex_unlock(&mp->global);
return error;
}
@@ -201,14 +206,23 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line)
{
+ int error;
if (mp->count != 0)
{
fprintf(stderr,"safe_mutex: Trying to destroy a mutex that was locked at %s, line %d at %s, line %d\n",
mp->file,mp->line, file, line);
abort();
}
+#ifdef __WIN__
+ error=0;
pthread_mutex_destroy(&mp->global);
- return pthread_mutex_destroy(&mp->mutex);
+ pthread_mutex_destroy(&mp->mutex);
+#else
+ if (pthread_mutex_destroy(&mp->global) ||
+ pthread_mutex_destroy(&mp->mutex))
+ error=1;
+#endif
+ return error;
}
#endif /* THREAD && SAFE_MUTEX */