summaryrefslogtreecommitdiffstats
path: root/sysutils/consolekit/files
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-02-05 08:51:00 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2008-02-05 08:51:00 +0800
commit27c03a13653107b693185975ab6f14c7138b5880 (patch)
tree4ac7b6ededb692020c582c410a18cd1c7554fc61 /sysutils/consolekit/files
parent8f4cd59dd878449f1b129778daece05fb4217ffc (diff)
downloadmarcuscom-ports-27c03a13653107b693185975ab6f14c7138b5880.tar
marcuscom-ports-27c03a13653107b693185975ab6f14c7138b5880.tar.gz
marcuscom-ports-27c03a13653107b693185975ab6f14c7138b5880.tar.bz2
marcuscom-ports-27c03a13653107b693185975ab6f14c7138b5880.tar.lz
marcuscom-ports-27c03a13653107b693185975ab6f14c7138b5880.tar.xz
marcuscom-ports-27c03a13653107b693185975ab6f14c7138b5880.tar.zst
marcuscom-ports-27c03a13653107b693185975ab6f14c7138b5880.zip
Fix a nasty bug in CK where the X session was not properly watched. This
resulted in the CK session being inactive which led to hal not properly working, and GDM shutdown/restart not to work. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@10342 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'sysutils/consolekit/files')
-rw-r--r--sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c62
1 files changed, 58 insertions, 4 deletions
diff --git a/sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c b/sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c
index 83f6b76e5..8311c9dbf 100644
--- a/sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c
+++ b/sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c
@@ -1,6 +1,17 @@
---- src/ck-sysdeps-freebsd.c.orig 2007-11-08 15:14:35.000000000 -0500
-+++ src/ck-sysdeps-freebsd.c 2007-11-08 15:14:45.000000000 -0500
-@@ -202,7 +202,6 @@ ck_process_stat_new_for_unix_pid (pid_t
+--- src/ck-sysdeps-freebsd.c.orig 2008-01-23 09:30:44.000000000 -0500
++++ src/ck-sysdeps-freebsd.c 2008-02-04 19:32:33.000000000 -0500
+@@ -43,6 +43,10 @@
+ ( (M&0xfff) << 8) | ( (m&0xfff00) << 12) | (m&0xff) \
+ )
+
++#ifndef MAXCONS
++#define MAXCONS 16
++#endif
++
+ #include "ck-sysdeps.h"
+
+ #ifndef ERROR
+@@ -202,7 +206,6 @@ ck_process_stat_new_for_unix_pid (pid_t
GError **error)
{
gboolean res;
@@ -8,7 +19,7 @@
CkProcessStat *proc;
g_return_val_if_fail (pid > 1, FALSE);
-@@ -217,7 +216,6 @@ ck_process_stat_new_for_unix_pid (pid_t
+@@ -217,7 +220,6 @@ ck_process_stat_new_for_unix_pid (pid_t
if (res) {
*stat = proc;
} else {
@@ -16,3 +27,46 @@
*stat = NULL;
}
+@@ -319,8 +321,10 @@ ck_get_max_num_consoles (guint *num)
+ {
+ int max_consoles;
+ int res;
++ int fd;
+ gboolean ret;
+ struct ttyent *t;
++ char *cdev;
+
+ ret = FALSE;
+ max_consoles = 0;
+@@ -331,9 +335,28 @@ ck_get_max_num_consoles (guint *num)
+ }
+
+ while ((t = getttyent ()) != NULL) {
+- if (t->ty_status & TTY_ON && strncmp (t->ty_name, "ttyv", 4) == 0)
+- max_consoles++;
+- }
++ if (t->ty_status & TTY_ON && strncmp (t->ty_name, "ttyv", 4) == 0) {
++ cdev = g_strdup_printf ("/dev/%s", t->ty_name);
++
++ fd = open (cdev, O_RDONLY | O_NOCTTY);
++ if (fd > -1) {
++ close (fd);
++ max_consoles++;
++ }
++ g_free (cdev);
++ }
++ }
++
++ if (max_consoles < MAXCONS) {
++ /* We do this once more to have a console for X sessions. */
++ cdev = g_strdup_printf ("/dev/ttyv%i", max_consoles);
++ fd = open (cdev, O_RDONLY | O_NOCTTY);
++ if (fd > -1) {
++ max_consoles++;
++ close (fd);
++ }
++ g_free (cdev);
++ }
+
+ /* Increment one more so that all consoles are properly counted
+ * this is arguable a bug in vt_add_watches().