diff options
author | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-11-02 11:26:18 -0300 |
---|---|---|
committer | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2011-11-02 11:26:18 -0300 |
commit | 01dfa0016c313f5ec5be0a8b624bac5031ff74a8 (patch) | |
tree | 6dfcf9c3c4143226d0ef65ce2d139f80f8fcacc1 /testing/gdm/gdm-vt-allocation-hack.patch | |
parent | 40e1222c1402c0d2aded73b95802f8197d0691a6 (diff) | |
parent | 9343f37ee7ba1aa98f65272412d331a280890e12 (diff) |
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts:
community/epdfview/PKGBUILD
community/gpa/PKGBUILD
community/gtk2hs-cairo/PKGBUILD
community/gtk2hs-glib/PKGBUILD
community/gtk2hs-gtk/PKGBUILD
community/gtk2hs-pango/PKGBUILD
community/lmctl/PKGBUILD
community/mediatomb/PKGBUILD
community/ruby-atk/PKGBUILD
community/ruby-gdkpixbuf2/PKGBUILD
community/ruby-gio2/PKGBUILD
community/ruby-glib2/PKGBUILD
community/ruby-pango/PKGBUILD
core/eglibc/glibc-2.10-bz4781.patch
core/eglibc/glibc-2.10-dont-build-timezone.patch
core/eglibc/glibc-2.12.1-static-shared-getpagesize.patch
core/eglibc/glibc-2.12.2-ignore-origin-of-privileged-program.patch
core/eglibc/glibc-2.13-futex.patch
core/eglibc/glibc-__i686.patch
extra/silc-toolkit/PKGBUILD
Diffstat (limited to 'testing/gdm/gdm-vt-allocation-hack.patch')
-rw-r--r-- | testing/gdm/gdm-vt-allocation-hack.patch | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/testing/gdm/gdm-vt-allocation-hack.patch b/testing/gdm/gdm-vt-allocation-hack.patch deleted file mode 100644 index 56fa5a151..000000000 --- a/testing/gdm/gdm-vt-allocation-hack.patch +++ /dev/null @@ -1,118 +0,0 @@ -diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c -index 39def47..03488fd 100644 ---- a/daemon/gdm-server.c -+++ b/daemon/gdm-server.c -@@ -33,6 +33,8 @@ - #include <grp.h> - #include <signal.h> - #include <sys/resource.h> -+#include <sys/ioctl.h> -+#include <sys/vt.h> - - #include <glib.h> - #include <glib/gi18n.h> -@@ -150,6 +152,92 @@ _gdm_server_query_ck_for_display_device (GdmServer *server) - return out; - } - -+#ifndef O_NOCTTY -+# define O_NOCTTY 0 -+#endif -+ -+static int -+open_vt (int vtno) -+{ -+ char *vtname; -+ int fd; -+ -+ vtname = g_strdup_printf ("/dev/tty%d", vtno); -+ -+ do { -+ errno = 0; -+ fd = open (vtname, O_RDWR | O_NOCTTY, 0); -+ } while (errno == EINTR); -+ -+ g_free (vtname); -+ return fd; -+} -+ -+static gint -+find_first_probably_free_vt (void) -+{ -+ int fd, fdv; -+ int vtno; -+ unsigned short vtmask; -+ struct vt_stat vtstat; -+ guint v_state; -+ -+ fdv = -1; -+ -+ do { -+ errno = 0; -+ fd = open ("/dev/console", O_WRONLY | O_NOCTTY, 0); -+ } while (errno == EINTR); -+ -+ if (fd >= 0) { -+ if (ioctl (fd, VT_GETSTATE, &vtstat) >= 0) { -+ v_state = vtstat.v_state; -+ } else { -+ close (fd); -+ v_state = 0; -+ fd = -1; -+ } -+ } else { -+ v_state = 0; -+ } -+ -+ if (fd < 0) { -+ do { -+ errno = 0; -+ fd = open ("/dev/console", O_RDONLY | O_NOCTTY, 0); -+ } while (errno == EINTR); -+ -+ if (fd >= 0) { -+ if (ioctl (fd, VT_GETSTATE, &vtstat) >= 0) -+ v_state = vtstat.v_state; -+ } -+ } -+ -+ for (vtno = 7, vtmask = 1 << vtno; vtmask; vtno++, vtmask <<= 1) { -+ /* Is this console in use? */ -+ if (v_state & vtmask) -+ continue; -+ -+ /* No, try to open it */ -+ fdv = open_vt (vtno); -+ if (fdv >= 0) -+ break; -+ -+ /* If we're here, kernel indicated that the console was free, -+ * but we failed to open it. Just go on to higher VTs. */ -+ } -+ -+ if (fdv >= 0) -+ close (fdv); -+ else -+ vtno = -1; -+ -+ if (fd >= 0) -+ close (fd); -+ -+ return vtno; -+} -+ - char * - gdm_server_get_display_device (GdmServer *server) - { -@@ -310,6 +398,11 @@ gdm_server_resolve_command_line (GdmServer *server, - - if (vtarg != NULL && ! gotvtarg) { - argv[len++] = g_strdup (vtarg); -+ } else if (!query_in_arglist && !gotvtarg) { -+ gint vtnum = find_first_probably_free_vt (); -+ -+ if (vtnum > 0) -+ argv [len++] = g_strdup_printf ("vt%d", vtnum); - } - - argv[len++] = NULL; |