Simpler patch; from pkgsrc.
This commit is contained in:
parent
76d2d6b631
commit
604b0262ea
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.90 2012/09/30 07:51:33 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.91 2012/10/10 17:20:36 ajacoutot Exp $
|
||||
|
||||
# DPB: not parallel-safe
|
||||
|
||||
@ -6,6 +6,7 @@ COMMENT= message bus system
|
||||
|
||||
DISTNAME= dbus-1.6.8
|
||||
EPOCH= 0
|
||||
REVISION= 0
|
||||
|
||||
SHARED_LIBS += dbus-1 10.2 # 10.2
|
||||
|
||||
|
@ -1,77 +0,0 @@
|
||||
$OpenBSD: patch-dbus_dbus-connection_c,v 1.10 2012/07/05 07:19:48 ajacoutot Exp $
|
||||
|
||||
From FreeBSD:
|
||||
Linux is more relaxed when it comes to the timeout argument to poll(2).
|
||||
Linux will accept aby negative number to mean an infinite timeout.
|
||||
OpenBSD will only accept INFTIM (-1). Make sure we do not pass an
|
||||
arbitrary negative number to poll(2) to avoid an infinite EINVAL loop.
|
||||
|
||||
--- dbus/dbus-connection.c.orig Wed Jun 6 12:45:55 2012
|
||||
+++ dbus/dbus-connection.c Thu Jul 5 07:47:00 2012
|
||||
@@ -2367,7 +2367,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);
|
||||
|
||||
@@ -2448,7 +2448,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;
|
||||
@@ -2474,7 +2478,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
|
||||
{
|
||||
@@ -2483,7 +2487,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
|
||||
pending,
|
||||
DBUS_ITERATION_DO_READING |
|
||||
DBUS_ITERATION_BLOCK,
|
||||
- timeout_milliseconds - elapsed_milliseconds);
|
||||
+ remain_milliseconds);
|
||||
}
|
||||
|
||||
goto recheck_status;
|
||||
@@ -2492,7 +2496,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)
|
||||
{
|
||||
@@ -2502,7 +2506,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
|
||||
{
|
||||
@@ -2511,7 +2515,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *
|
||||
NULL,
|
||||
DBUS_ITERATION_DO_READING |
|
||||
DBUS_ITERATION_BLOCK,
|
||||
- timeout_milliseconds - elapsed_milliseconds);
|
||||
+ remain_milliseconds);
|
||||
}
|
||||
|
||||
goto recheck_status;
|
19
x11/dbus/patches/patch-dbus_dbus-sysdeps-unix_c
Normal file
19
x11/dbus/patches/patch-dbus_dbus-sysdeps-unix_c
Normal file
@ -0,0 +1,19 @@
|
||||
$OpenBSD: patch-dbus_dbus-sysdeps-unix_c,v 1.11 2012/10/10 17:20:36 ajacoutot Exp $
|
||||
|
||||
From pkgsrc:
|
||||
_dbus_poll: set the timeout value argument to poll to -1 whenever it is
|
||||
less than -1 to avoid an infinite EINVAL loop.
|
||||
|
||||
--- dbus/dbus-sysdeps-unix.c.orig Fri Sep 28 21:31:47 2012
|
||||
+++ dbus/dbus-sysdeps-unix.c Wed Oct 10 17:53:43 2012
|
||||
@@ -2525,6 +2525,10 @@ _dbus_poll (DBusPollFD *fds,
|
||||
_DBUS_STRUCT_OFFSET (DBusPollFD, revents) ==
|
||||
_DBUS_STRUCT_OFFSET (struct pollfd, revents))
|
||||
{
|
||||
+ if (timeout_milliseconds < -1) {
|
||||
+ _dbus_warn("_dbus_poll: timeout = %d (fixed)\n", timeout_milliseconds);
|
||||
+ timeout_milliseconds = -1;
|
||||
+ }
|
||||
return poll ((struct pollfd*) fds,
|
||||
n_fds,
|
||||
timeout_milliseconds);
|
Loading…
Reference in New Issue
Block a user