From e8e615d03a2b7d018b8320fa66bebdbd4cf2c6df Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 21 Aug 2024 13:01:08 +0000 Subject: [PATCH] Use APR_TIMEUP for ETIMEDOUT too ... in apr_proc_mutex_timedlock(). Related to PR53906 AIX manpage: ETIMEDOUT The time specified by the Timeout parameter expired before the requested operations could be completed. (no EAGAIN) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1920113 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ locks/unix/proc_mutex.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9d7ec27c47..800e811ff9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_proc_mutex_timedlock() should return APR_TIMEUP on systems + where semtimedop() returns ETIMEDOUT rather than + EAGAIN. Likely AIX-only. [Eric Covener] + *) apr_ldap: Add the new APR LDAP API. [Graham Leggett] *) Add APR_OFF_MAX to give the maximum value of apr_off_t. [Graham diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index 74efb84e07..88ca37c560 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -390,7 +390,7 @@ static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex, &reltime); } while (rc < 0 && errno == EINTR); if (rc < 0) { - if (errno == EAGAIN) { + if (errno == EAGAIN || errno == ETIMEDOUT) { return APR_TIMEUP; } return errno;