diff options
author | Roy Marples <uberlord@gentoo.org> | 2007-10-31 21:32:28 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2007-10-31 21:32:28 +0000 |
commit | 10d7520cc09cfe037cea00b4c04e718cec3036c0 (patch) | |
tree | 7486b53d24e8d91cd4f3ee46b9699ee9705afbef /sys-auth/consolekit | |
parent | Fixing Manifest (diff) | |
download | gentoo-2-10d7520cc09cfe037cea00b4c04e718cec3036c0.tar.gz gentoo-2-10d7520cc09cfe037cea00b4c04e718cec3036c0.tar.bz2 gentoo-2-10d7520cc09cfe037cea00b4c04e718cec3036c0.zip |
Add a workaround for a FreeBSD kernel bug so consolekit stops when in use.
(Portage version: 2.1.3.16)
Diffstat (limited to 'sys-auth/consolekit')
-rw-r--r-- | sys-auth/consolekit/ChangeLog | 6 | ||||
-rw-r--r-- | sys-auth/consolekit/consolekit-0.2.3.ebuild | 10 | ||||
-rw-r--r-- | sys-auth/consolekit/files/consolekit-0.2.3-freebsd.patch | 107 |
3 files changed, 121 insertions, 2 deletions
diff --git a/sys-auth/consolekit/ChangeLog b/sys-auth/consolekit/ChangeLog index 07d16df8e32f..5c763eb770fa 100644 --- a/sys-auth/consolekit/ChangeLog +++ b/sys-auth/consolekit/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-auth/consolekit # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-auth/consolekit/ChangeLog,v 1.24 2007/10/18 15:43:51 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-auth/consolekit/ChangeLog,v 1.25 2007/10/31 21:32:27 uberlord Exp $ + + 31 Oct 2007; Roy Marples <uberlord@gentoo.org> + +files/consolekit-0.2.3-freebsd.patch, consolekit-0.2.3.ebuild: + Add a workaround for a FreeBSD kernel bug so consolekit stops when in use. 18 Oct 2007; Roy Marples <uberlord@gentoo.org> consolekit-0.2.3.ebuild: Keyworded ~x86-fbsd diff --git a/sys-auth/consolekit/consolekit-0.2.3.ebuild b/sys-auth/consolekit/consolekit-0.2.3.ebuild index efc5e3bb3a01..b66b11a05c68 100644 --- a/sys-auth/consolekit/consolekit-0.2.3.ebuild +++ b/sys-auth/consolekit/consolekit-0.2.3.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-auth/consolekit/consolekit-0.2.3.ebuild,v 1.4 2007/10/18 15:43:51 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-auth/consolekit/consolekit-0.2.3.ebuild,v 1.5 2007/10/31 21:32:27 uberlord Exp $ inherit eutils autotools multilib pam @@ -28,6 +28,14 @@ DEPEND="${RDEPEND} S="${WORKDIR}/${MY_PN}-${MY_PV}" +src_unpack() { + unpack ${A} + cd "${S}" + + # Work around an apparent FreeBSD kernel bug + use x86-fbsd && epatch "${FILESDIR}/${P}"-freebsd.patch +} + src_compile() { econf $(use_enable debug) \ $(use_enable pam pam-module) \ diff --git a/sys-auth/consolekit/files/consolekit-0.2.3-freebsd.patch b/sys-auth/consolekit/files/consolekit-0.2.3-freebsd.patch new file mode 100644 index 000000000000..2e5744092817 --- /dev/null +++ b/sys-auth/consolekit/files/consolekit-0.2.3-freebsd.patch @@ -0,0 +1,107 @@ +diff --git a/src/ck-sysdeps-unix.c b/src/ck-sysdeps-unix.c
+index 0001b6b..bcdfb21 100644
+--- a/src/ck-sysdeps-unix.c
++++ b/src/ck-sysdeps-unix.c
+@@ -267,7 +267,13 @@ ck_wait_for_active_console_num (int console_fd,
+ g_debug ("Interrupted waiting for native console %d activation: %s",
+ num,
+ errmsg);
++#if !defined(__FreeBSD__)
++ /* We don't want to retry on FreeBSD since getting
++ * EINTR means we are terminating, and we don't want
++ * to keep restarting our active VT check.
++ */
+ goto again;
++#endif
+ } else {
+ g_warning ("Error waiting for native console %d activation: %s",
+ num,
+diff --git a/src/main.c b/src/main.c
+index 11b6f2e..af2998b 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -245,6 +245,27 @@ setup_debug_log_signals (void)
+ }
+
+ static void
++terminate (int sig __unused)
++{
++ return;
++}
++
++static void
++setup_termination_signals (void)
++{
++ struct sigaction sa;
++
++ sa.sa_handler = terminate;
++ sigemptyset (&sa.sa_mask);
++ sa.sa_flags = 0;
++
++ sigaction (SIGTERM, &sa, NULL);
++ sigaction (SIGQUIT, &sa, NULL);
++ sigaction (SIGINT, &sa, NULL);
++ sigaction (SIGHUP, &sa, NULL);
++}
++
++static void
+ setup_debug_log (gboolean debug)
+ {
+ ck_log_init ();
+@@ -300,6 +321,8 @@ main (int argc,
+
+ setup_debug_log (debug);
+
++ setup_termination_signals ();
++
+ connection = get_system_bus ();
+ if (connection == NULL) {
+ goto out;
+diff --git a/src/test-vt-monitor.c b/src/test-vt-monitor.c
+index c445865..e31b24e 100644
+--- a/src/test-vt-monitor.c
++++ b/src/test-vt-monitor.c
+@@ -30,6 +30,7 @@
+ #include <fcntl.h>
+ #include <pwd.h>
+ #include <string.h>
++#include <signal.h>
+ #include <errno.h>
+
+ #include <locale.h>
+@@ -47,6 +48,12 @@ activated_cb (CkVtMonitor *monitor,
+ g_message ("VT %u activated", num);
+ }
+
++static void
++terminate (int sig __unused)
++{
++ return;
++}
++
+ int
+ main (int argc, char **argv)
+ {
+@@ -55,12 +62,22 @@ main (int argc, char **argv)
+ GError *error;
+ guint num;
+ gboolean res;
++ struct sigaction sa;
+
+ if (! g_thread_supported ()) {
+ g_thread_init (NULL);
+ }
+ g_type_init ();
+
++ sa.sa_handler = terminate;
++ sigemptyset (&sa.sa_mask);
++ sa.sa_flags = 0;
++
++ sigaction (SIGINT, &sa, NULL);
++ sigaction (SIGTERM, &sa, NULL);
++ sigaction (SIGQUIT, &sa, NULL);
++ sigaction (SIGHUP, &sa, NULL);
++
+ if (! ck_is_root_user ()) {
+ g_warning ("Must be run as root");
+ exit (1);
|