git: 6024c2a1b1f5 - main - devel/dbus: Bring one of our patches to the upstream state

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Fri, 16 May 2025 11:11:40 UTC
The branch main has been updated by arrowd:

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

commit 6024c2a1b1f592e0090c773be34259dc58e41d4a
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-05-16 07:17:07 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-05-16 11:11:37 +0000

    devel/dbus: Bring one of our patches to the upstream state
    
    See https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/524
---
 devel/dbus/Makefile                           |  2 +-
 devel/dbus/files/patch-dbus_dbus-connection.c | 59 +++------------------------
 2 files changed, 6 insertions(+), 55 deletions(-)

diff --git a/devel/dbus/Makefile b/devel/dbus/Makefile
index b1b182a97bca..1ecf854e8588 100644
--- a/devel/dbus/Makefile
+++ b/devel/dbus/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	dbus
 DISTVERSION=	1.16.2
-PORTREVISION=	2
+PORTREVISION=	3
 PORTEPOCH=	1
 CATEGORIES=	devel gnome
 MASTER_SITES=	https://dbus.freedesktop.org/releases/dbus/
diff --git a/devel/dbus/files/patch-dbus_dbus-connection.c b/devel/dbus/files/patch-dbus_dbus-connection.c
index 58b587c84140..05bd0cd15fd4 100644
--- a/devel/dbus/files/patch-dbus_dbus-connection.c
+++ b/devel/dbus/files/patch-dbus_dbus-connection.c
@@ -1,69 +1,20 @@
---- dbus/dbus-connection.c.orig	2018-02-08 14:07:21 UTC
+--- dbus/dbus-connection.c.orig	2025-02-27 16:29:06 UTC
 +++ dbus/dbus-connection.c
-@@ -2385,7 +2385,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
-   DBusConnection *connection;
-   dbus_uint32_t client_serial;
-   DBusTimeout *timeout;
--  int timeout_milliseconds, elapsed_milliseconds;
-+  int timeout_milliseconds, elapsed_milliseconds, remain_milliseconds;
- 
-   _dbus_assert (pending != NULL);
- 
-@@ -2466,7 +2466,11 @@ _dbus_connection_block_pending_call (DBusPendingCall *
-   _dbus_get_monotonic_time (&tv_sec, &tv_usec);
-   elapsed_milliseconds = (tv_sec - start_tv_sec) * 1000 +
- 	  (tv_usec - start_tv_usec) / 1000;
--  
-+  if (timeout_milliseconds != -1)
-+    remain_milliseconds = timeout_milliseconds - elapsed_milliseconds;
-+  else
-+    remain_milliseconds = -1;
-+
-   if (!_dbus_connection_get_is_connected_unlocked (connection))
-     {
-       DBusMessage *error_msg;
-@@ -2494,7 +2498,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
-            */
-           _dbus_verbose ("dbus_connection_send_with_reply_and_block() waiting for more memory\n");
- 
--          _dbus_memory_pause_based_on_timeout (timeout_milliseconds - elapsed_milliseconds);
-+          _dbus_memory_pause_based_on_timeout (remain_milliseconds);
-         }
-       else
-         {          
-@@ -2503,7 +2507,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
-                                                   pending,
-                                                   DBUS_ITERATION_DO_READING |
-                                                   DBUS_ITERATION_BLOCK,
--                                                  timeout_milliseconds - elapsed_milliseconds);
-+                                                  remain_milliseconds);
-         }
- 
-       goto recheck_status;
-@@ -2512,7 +2516,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
-     _dbus_verbose ("dbus_connection_send_with_reply_and_block(): clock set backward\n");
-   else if (elapsed_milliseconds < timeout_milliseconds)
-     {
--      _dbus_verbose ("dbus_connection_send_with_reply_and_block(): %d milliseconds remain\n", timeout_milliseconds - elapsed_milliseconds);
-+      _dbus_verbose ("dbus_connection_send_with_reply_and_block(): %d milliseconds remain\n", remain_milliseconds);
-       
-       if (status == DBUS_DISPATCH_NEED_MEMORY)
-         {
-@@ -2522,7 +2526,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
+@@ -2510,7 +2510,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
             */
            _dbus_verbose ("dbus_connection_send_with_reply_and_block() waiting for more memory\n");
  
 -          _dbus_memory_pause_based_on_timeout (timeout_milliseconds - elapsed_milliseconds);
-+          _dbus_memory_pause_based_on_timeout (remain_milliseconds);
++          _dbus_memory_pause_based_on_timeout (-1);
          }
        else
          {          
-@@ -2531,7 +2535,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
+@@ -2519,7 +2519,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
                                                    pending,
                                                    DBUS_ITERATION_DO_READING |
                                                    DBUS_ITERATION_BLOCK,
 -                                                  timeout_milliseconds - elapsed_milliseconds);
-+                                                  remain_milliseconds);
++                                                  -1);
          }
  
        goto recheck_status;