summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorkaa@polly.local <>2006-12-18 18:04:26 +0300
committerkaa@polly.local <>2006-12-18 18:04:26 +0300
commitd7777d14c6d11024fe7dc2cf2930523ccd7765bd (patch)
tree333ec69c4920a35d9c0d9a9f5304f4fd626f6d2a /mysys
parentfeb0e3a0f210c4f7c4ffdfe132e2ad424eaa7605 (diff)
parente5710dee6f63d143e9c198b364a511b62fb5c421 (diff)
downloadmariadb-git-d7777d14c6d11024fe7dc2cf2930523ccd7765bd.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into polly.local:/home/kaa/src/maint/mysql-5.0-maint
Diffstat (limited to 'mysys')
-rw-r--r--mysys/default.c10
-rw-r--r--mysys/my_wincond.c19
2 files changed, 16 insertions, 13 deletions
diff --git a/mysys/default.c b/mysys/default.c
index d93f4135e73..a147163e938 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -979,10 +979,11 @@ static uint my_get_system_windows_directory(char *buffer, uint size)
Everywhere else, this is:
1. /etc/
- 2. getenv(DEFAULT_HOME_ENV)
- 3. ""
- 4. "~/"
- 5. --sysconfdir=<path>
+ 2. /etc/mysql/
+ 3. getenv(DEFAULT_HOME_ENV)
+ 4. ""
+ 5. "~/"
+ 6. --sysconfdir=<path>
*/
@@ -1008,6 +1009,7 @@ static void init_default_directories()
*ptr++= env;
#endif
*ptr++= "/etc/";
+ *ptr++= "/etc/mysql/";
#endif
if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV))))
*ptr++= env;
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index 327addff2cc..b56dacc135a 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -37,7 +37,7 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
int pthread_cond_destroy(pthread_cond_t *cond)
{
- return CloseHandle(cond->semaphore) ? 0 : EINVAL;
+ return CloseHandle(cond->semaphore) ? 0 : EINVAL;
}
@@ -51,6 +51,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
return 0 ;
}
+
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime)
{
@@ -61,26 +62,26 @@ int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
GetSystemTimeAsFileTime(&now.ft);
/*
- - subtract start time from current time(values are in 100ns units
+ Calculate time left to abstime
+ - subtract start time from current time(values are in 100ns units)
- convert to millisec by dividing with 10000
- - subtract time since start from max timeout
*/
- timeout= abstime->timeout_msec - (long)((now.i64 - abstime->start.i64) / 10000);
+ timeout= (long)((abstime->tv.i64 - now.i64) / 10000);
/* Don't allow the timeout to be negative */
if (timeout < 0)
- timeout = 0L;
+ timeout= 0L;
/*
- Make sure the calucated time does not exceed original timeout
+ Make sure the calucated timeout does not exceed original timeout
value which could cause "wait for ever" if system time changes
*/
- if (timeout > abstime->timeout_msec)
- timeout= abstime->timeout_msec;
+ if (timeout > abstime->max_timeout_msec)
+ timeout= abstime->max_timeout_msec;
InterlockedIncrement(&cond->waiting);
LeaveCriticalSection(mutex);
- result=WaitForSingleObject(cond->semaphore,timeout);
+ result= WaitForSingleObject(cond->semaphore,timeout);
InterlockedDecrement(&cond->waiting);
EnterCriticalSection(mutex);