summaryrefslogtreecommitdiff
path: root/mysys/my_pthread.c
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-06-17 09:56:27 +0300
committerunknown <monty@mashka.mysql.fi>2002-06-17 09:56:27 +0300
commit92240b8ca37b80ba29f14f064de9059d9605edee (patch)
tree91c87c2e9dc4ad559145a6551e623daab59413c1 /mysys/my_pthread.c
parenta17ad22af4d837020619f7480e89ff5bb0c066a6 (diff)
downloadmariadb-git-92240b8ca37b80ba29f14f064de9059d9605edee.tar.gz
Portability fix for HPUX
mysys/my_pthread.c: Portability fix BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r--mysys/my_pthread.c11
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 */