diff options
author | monty@mashka.mysql.fi <> | 2002-06-17 09:56:27 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-06-17 09:56:27 +0300 |
commit | 8d75ff64e1e0059741f70b7e52f41ac4acce4817 (patch) | |
tree | 91c87c2e9dc4ad559145a6551e623daab59413c1 /mysys/my_pthread.c | |
parent | a1e50625f03581d1c732a387eebe84939ed9cd88 (diff) | |
download | mariadb-git-8d75ff64e1e0059741f70b7e52f41ac4acce4817.tar.gz |
Portability fix for HPUX
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r-- | mysys/my_pthread.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index b9b05e21375..696b62f8b0e 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -416,8 +416,15 @@ int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *abstime) { - int error=pthread_cond_timedwait(cond,mutex,abstime); - return (error == EAGAIN || error == -1) ? ETIMEDOUT : error; + int error=pthread_cond_timedwait(cond, mutex, abstime); + if (error == -1) /* Safety if the lib is fixed */ + { + if (!(error=errno)) + error= ETIMEDOUT; /* Can happen on HPUX */ + } + if (error == EAGAIN) /* Correct errno to Posix */ + error= ETIMEDOUT; + return error; } #endif /* HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT */ |