aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2007-03-22 05:25:12 +0800
committermarcus <marcus@FreeBSD.org>2007-03-22 05:25:12 +0800
commit604977e3e6d62b304526dd29a6ba61d31a2c46a3 (patch)
treef29498a1bca7dbdc372db8a2ee34adf7eb8db96d /devel
parent18bc11dc45d3c4ad04184e5a8c9ba1d998afebbe (diff)
downloadfreebsd-ports-gnome-604977e3e6d62b304526dd29a6ba61d31a2c46a3.tar.gz
freebsd-ports-gnome-604977e3e6d62b304526dd29a6ba61d31a2c46a3.tar.zst
freebsd-ports-gnome-604977e3e6d62b304526dd29a6ba61d31a2c46a3.zip
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.
Diffstat (limited to 'devel')
-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);
+ }