Portability fix for HPUX

mysys/my_pthread.c:
  Portability fix
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
This commit is contained in:
unknown 2002-06-17 09:56:27 +03:00
commit 92240b8ca3
2 changed files with 10 additions and 2 deletions

View file

@ -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 */