summaryrefslogtreecommitdiff
path: root/devel/dbus
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2007-03-21 21:25:12 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2007-03-21 21:25:12 +0000
commite04da502899e02716a3a0a96ba96f5623ccaaad3 (patch)
treef01b3f4ceb35a8788dce286ad5fa4a9df67233e9 /devel/dbus
parentUpdate to 1.0rc3, see changelog for details: (diff)
Ignore SIGPIPE (and EPIPE) when writing out PID to a client. Some clients
(like gnome-session) close the pipe too early resulting in dbus-daemon terminating.
Notes
Notes: svn path=/head/; revision=187939
Diffstat (limited to 'devel/dbus')
-rw-r--r--devel/dbus/Makefile2
-rw-r--r--devel/dbus/files/patch-bus_bus.c30
-rw-r--r--devel/dbus/files/patch-dbus_dbus-sysdeps-util-unix.c23
3 files changed, 54 insertions, 1 deletions
diff --git a/devel/dbus/Makefile b/devel/dbus/Makefile
index c2e31866d947..fde02319f410 100644
--- a/devel/dbus/Makefile
+++ b/devel/dbus/Makefile
@@ -7,7 +7,7 @@
PORTNAME= dbus
PORTVERSION?= 1.0.2
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= devel gnome
MASTER_SITES= http://dbus.freedesktop.org/releases/dbus/
diff --git a/devel/dbus/files/patch-bus_bus.c b/devel/dbus/files/patch-bus_bus.c
new file mode 100644
index 000000000000..af6b06529fe3
--- /dev/null
+++ b/devel/dbus/files/patch-bus_bus.c
@@ -0,0 +1,30 @@
+--- bus/bus.c.orig Wed Mar 21 16:20:57 2007
++++ bus/bus.c Wed Mar 21 16:22:08 2007
+@@ -21,6 +21,7 @@
+ *
+ */
+
++#include <signal.h>
+ #include "bus.h"
+ #include "activation.h"
+ #include "connection.h"
+@@ -731,14 +732,18 @@ bus_context_new (const DBusString *confi
+ }
+
+ bytes = _dbus_string_get_length (&pid);
+- if (_dbus_write_socket (print_pid_fd, &pid, 0, bytes) != bytes)
++ signal (SIGPIPE, SIG_IGN);
++ if (_dbus_write_socket (print_pid_fd, &pid, 0, bytes) != bytes &&
++ errno != EPIPE)
+ {
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "Printing message bus PID: %s\n",
+ _dbus_strerror (errno));
+ _dbus_string_free (&pid);
++ signal (SIGPIPE, SIG_DFL);
+ goto failed;
+ }
++ signal (SIGPIPE, SIG_DFL);
+
+ if (print_pid_fd > 2)
+ _dbus_close_socket (print_pid_fd, NULL);
diff --git a/devel/dbus/files/patch-dbus_dbus-sysdeps-util-unix.c b/devel/dbus/files/patch-dbus_dbus-sysdeps-util-unix.c
new file mode 100644
index 000000000000..4a6bf2c7a505
--- /dev/null
+++ b/devel/dbus/files/patch-dbus_dbus-sysdeps-util-unix.c
@@ -0,0 +1,23 @@
+--- dbus/dbus-sysdeps-util-unix.c.orig Mon Dec 11 14:21:10 2006
++++ dbus/dbus-sysdeps-util-unix.c Wed Mar 21 16:22:45 2007
+@@ -157,15 +157,19 @@ _dbus_become_daemon (const DBusString *p
+ }
+
+ bytes = _dbus_string_get_length (&pid);
+- if (_dbus_write_socket (print_pid_fd, &pid, 0, bytes) != bytes)
++ signal (SIGPIPE, SIG_IGN);
++ if (_dbus_write_socket (print_pid_fd, &pid, 0, bytes) != bytes &&
++ errno != EPIPE)
+ {
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "Printing message bus PID: %s\n",
+ _dbus_strerror (errno));
+ _dbus_string_free (&pid);
+ kill (child_pid, SIGTERM);
++ signal (SIGPIPE, SIG_DFL);
+ return FALSE;
+ }
++ signal (SIGPIPE, SIG_DFL);
+
+ _dbus_string_free (&pid);
+ }