git: efc00d9fd418 - main - devel/apr1: Fix poll(2) timeout issue

From: Bernard Spil <brnrd_at_FreeBSD.org>
Date: Sat, 16 Nov 2024 11:23:35 UTC
The branch main has been updated by brnrd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=efc00d9fd418d84a1f88c3b74a2d07bd41df7f91

commit efc00d9fd418d84a1f88c3b74a2d07bd41df7f91
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2024-11-16 11:20:26 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2024-11-16 11:20:26 +0000

    devel/apr1: Fix poll(2) timeout issue
    
    Fix by jkim
    
    PR:             282137
    Reported by:    Tomáš Čiernik <tomas ciernik sk>
---
 devel/apr1/Makefile                          |  2 +-
 devel/apr1/files/patch-support_unix_waitio.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/devel/apr1/Makefile b/devel/apr1/Makefile
index b1c9953eeecd..da0b55d549c2 100644
--- a/devel/apr1/Makefile
+++ b/devel/apr1/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	apr
 PORTVERSION=	${APR_VERSION}.${APU_VERSION}
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	devel
 MASTER_SITES=	APACHE/apr
 DISTFILES=	apr-${APR_VERSION}.tar.gz \
diff --git a/devel/apr1/files/patch-support_unix_waitio.c b/devel/apr1/files/patch-support_unix_waitio.c
new file mode 100644
index 000000000000..0b1e17d43360
--- /dev/null
+++ b/devel/apr1/files/patch-support_unix_waitio.c
@@ -0,0 +1,14 @@
+--- apr-1.7.5/support/unix/waitio.c	(revision 1921905)
++++ apr-1.7.5/support/unix/waitio.c	(working copy)
+@@ -46,7 +46,10 @@ apr_status_t apr_wait_for_io_or_timeout(apr_file_t
+     pfd.fd     = f        ? f->filedes        : s->socketdes;
+     pfd.events = for_read ? POLLIN            : POLLOUT;
+ 
+-    if (timeout > 0) {
++    if (timeout < 0) {
++        timeout = -1;
++    }
++    else if (timeout > 0) {
+         timeout = (timeout + 999) / 1000;
+     }
+     do {