0001-Make-the-default-DBus-reply-timeout-configurable.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From fb546488e93a1638d377b228bbb0d2ab58462168 Mon Sep 17 00:00:00 2001
  2. From: Daniel Willmann <daniel@totalueberwachung.de>
  3. Date: Thu, 2 Oct 2008 15:50:17 +0800
  4. Subject: [PATCH] Make the default DBus reply timeout configurable
  5. This patch adds an option --with-dbus-default-reply-timeout to configure
  6. that will set the default reply timeout used by libdbus in milliseconds.
  7. autoconf and autoheader need to be rerun in order to regenerate the
  8. correct configure and config.h.in files.
  9. ---
  10. configure.in | 9 +++++++++
  11. dbus/dbus-connection-internal.h | 3 ---
  12. dbus/dbus-pending-call.c | 1 +
  13. 3 files changed, 10 insertions(+), 3 deletions(-)
  14. diff --git a/configure.in b/configure.in
  15. index 62ac387..5c912d7 100644
  16. --- a/configure.in
  17. +++ b/configure.in
  18. @@ -88,6 +88,7 @@ AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]]
  19. AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
  20. AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
  21. AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
  22. +AC_ARG_WITH(dbus_default_reply_timeout, AS_HELP_STRING([--with-dbus-default-reply-timeout=[milliseconds]],[Default reply timeout for DBus method calls]))
  23. AC_DEFINE(DBUS_UNIX,1,[dbus on unix])
  24. @@ -986,6 +987,13 @@ if test x$have_libaudit = xyes ; then
  25. AC_DEFINE(HAVE_LIBAUDIT,1,[audit daemon SELinux support])
  26. fi
  27. +if test -z "$with_dbus_default_reply_timeout" ; then
  28. + DBUS_DEFAULT_REPLY_TIMEOUT=25000
  29. +else
  30. + DBUS_DEFAULT_REPLY_TIMEOUT=$with_dbus_default_reply_timeout
  31. +fi
  32. +AC_DEFINE_UNQUOTED(_DBUS_DEFAULT_TIMEOUT_VALUE,$DBUS_DEFAULT_REPLY_TIMEOUT,[default timeout value for dbus calls])
  33. +
  34. #### Set up final flags
  35. DBUS_CLIENT_CFLAGS=
  36. DBUS_CLIENT_LIBS="$THREAD_LIBS"
  37. @@ -1348,6 +1356,7 @@ echo "
  38. Gettext libs (empty OK): ${INTLLIBS}
  39. Using XML parser: ${with_xml}
  40. Init scripts style: ${with_init_scripts}
  41. + Default reply timeout: ${DBUS_DEFAULT_REPLY_TIMEOUT}
  42. Abstract socket names: ${ac_cv_have_abstract_sockets}
  43. System bus socket: ${DBUS_SYSTEM_SOCKET}
  44. System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
  45. diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h
  46. index df54412..5fe536b 100644
  47. --- a/dbus/dbus-connection-internal.h
  48. +++ b/dbus/dbus-connection-internal.h
  49. @@ -41,9 +41,6 @@ typedef enum
  50. DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */
  51. } DBusIterationFlags;
  52. -/** default timeout value when waiting for a message reply, 25 seconds */
  53. -#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
  54. -
  55. void _dbus_connection_lock (DBusConnection *connection);
  56. void _dbus_connection_unlock (DBusConnection *connection);
  57. DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
  58. diff --git a/dbus/dbus-pending-call.c b/dbus/dbus-pending-call.c
  59. index 51b9378..5a7a5f4 100644
  60. --- a/dbus/dbus-pending-call.c
  61. +++ b/dbus/dbus-pending-call.c
  62. @@ -21,6 +21,7 @@
  63. *
  64. */
  65. +#include <config.h>
  66. #include "dbus-internals.h"
  67. #include "dbus-connection-internal.h"
  68. #include "dbus-pending-call-internal.h"
  69. --
  70. 1.5.6.4