diff options
author | 2007-10-31 21:32:28 +0000 | |
---|---|---|
committer | 2007-10-31 21:32:28 +0000 | |
commit | 10d7520cc09cfe037cea00b4c04e718cec3036c0 (patch) | |
tree | 7486b53d24e8d91cd4f3ee46b9699ee9705afbef /sys-auth/consolekit/files | |
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/files')
-rw-r--r-- | sys-auth/consolekit/files/consolekit-0.2.3-freebsd.patch | 107 |
1 files changed, 107 insertions, 0 deletions
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);
|