diff options
author | bland <bland@FreeBSD.org> | 2004-06-23 21:25:48 +0800 |
---|---|---|
committer | bland <bland@FreeBSD.org> | 2004-06-23 21:25:48 +0800 |
commit | 04d64e9cc53c362119228845fd5f554e7cdbacff (patch) | |
tree | 09ff8446034d673202bae78dbfa0a34aec7a87ae /x11/gdm2 | |
parent | 63e54bb80d88a4a7d5fac9b834e53a81b8edf77e (diff) | |
download | freebsd-ports-gnome-04d64e9cc53c362119228845fd5f554e7cdbacff.tar.gz freebsd-ports-gnome-04d64e9cc53c362119228845fd5f554e7cdbacff.tar.zst freebsd-ports-gnome-04d64e9cc53c362119228845fd5f554e7cdbacff.zip |
Implement VTAllocation support.
Diffstat (limited to 'x11/gdm2')
-rw-r--r-- | x11/gdm2/Makefile | 1 | ||||
-rw-r--r-- | x11/gdm2/files/patch-daemon::getvt.c | 100 | ||||
-rw-r--r-- | x11/gdm2/files/patch-daemon_gdm.c | 24 |
3 files changed, 122 insertions, 3 deletions
diff --git a/x11/gdm2/Makefile b/x11/gdm2/Makefile index 65e92dff5cbf..f99a61b6aeb4 100644 --- a/x11/gdm2/Makefile +++ b/x11/gdm2/Makefile @@ -7,6 +7,7 @@ PORTNAME= gdm2 PORTVERSION= 2.6.0.3 +PORTREVISION= 1 CATEGORIES= x11 gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/${PORTNAME:S/2$//}/2.6 diff --git a/x11/gdm2/files/patch-daemon::getvt.c b/x11/gdm2/files/patch-daemon::getvt.c new file mode 100644 index 000000000000..e9a45ce3538f --- /dev/null +++ b/x11/gdm2/files/patch-daemon::getvt.c @@ -0,0 +1,100 @@ +--- daemon/getvt.c.orig Tue Jan 6 14:56:39 2004 ++++ daemon/getvt.c Wed Jun 23 17:13:16 2004 +@@ -19,15 +19,42 @@ + extern int GdmFirstVT; + extern gboolean GdmVTAllocation; + +-#ifdef __linux__ ++#if defined (__linux__) || defined (__FreeBSD__) + ++#ifdef __linux__ + #include <sys/vt.h> ++#endif ++#ifdef __FreeBSD__ ++#include <sys/consio.h> ++#endif ++ ++#ifdef __FreeBSD__ ++static const char* ++__itovty(int val) ++{ ++ static char str[8]; ++ char* next = str + sizeof (str) - 1; ++ ++ *next = '\0'; ++ do { ++ *--next = "0123456789abcdefghigklmnopqrstuv"[val % 32]; ++ } while (val /= 32); ++ ++ return next; ++} ++#endif + + static int + open_vt (int vtno) + { +- char *vtname = g_strdup_printf ("/dev/tty%d", vtno); ++ char *vtname; + int fd; ++ ++#if defined (__linux__) ++ vtname = g_strdup_printf ("/dev/tty%d", vtno); ++#elif defined (__FreeBSD__) ++ vtname = g_strdup_printf ("/dev/ttyv%s", __itovty(vtno - 1)); ++#endif + do { + errno = 0; + fd = open (vtname, O_RDWR +@@ -76,7 +103,11 @@ + to_close_vts = g_list_prepend (to_close_vts, + GINT_TO_POINTER (fdv)); + ++#if defined (__linux__) + if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) { ++#elif defined (__FreeBSD__) ++ if (ioctl(fd, VT_OPENQRY, &vtno) == -1) { ++#endif + vtno = -1; + goto cleanup; + } +@@ -145,7 +176,11 @@ + int + gdm_get_cur_vt (void) + { ++#if defined (__linux__) + struct vt_stat s; ++#elif defined (__FreeBSD__) ++ int vtno; ++#endif + int fd; + + do { +@@ -158,7 +193,7 @@ + } while G_UNLIKELY (errno == EINTR); + if (fd < 0) + return -1; +- ++#if defined (__linux__) + ioctl (fd, VT_GETSTATE, &s); + + VE_IGNORE_EINTR (close (fd)); +@@ -167,6 +202,19 @@ + printf ("current_Active %d\n", (int)s.v_active); + + return s.v_active; ++#elif defined (__FreeBSD__) ++ if (ioctl (fd, VT_GETACTIVE, &vtno) == -1) { ++ VE_IGNORE_EINTR (close (fd)); ++ return -1; ++ } ++ ++ VE_IGNORE_EINTR (close (fd)); ++ ++ /* debug */ ++ printf ("current_Active %d\n", vtno); ++ ++ return vtno; ++#endif + } + + #else /* here this is just a stub, we don't know how to do this outside diff --git a/x11/gdm2/files/patch-daemon_gdm.c b/x11/gdm2/files/patch-daemon_gdm.c index 787890f2a06e..0c04ced58526 100644 --- a/x11/gdm2/files/patch-daemon_gdm.c +++ b/x11/gdm2/files/patch-daemon_gdm.c @@ -1,6 +1,6 @@ ---- daemon/gdm.c.orig Wed Jun 25 17:04:49 2003 -+++ daemon/gdm.c Sat Jun 28 18:17:44 2003 -@@ -38,7 +38,7 @@ +--- daemon/gdm.c.orig Mon Apr 5 03:11:28 2004 ++++ daemon/gdm.c Tue May 11 00:04:26 2004 +@@ -42,7 +42,7 @@ #include <locale.h> /* This should be moved to auth.c I suppose */ @@ -9,3 +9,21 @@ #include <vicious.h> +@@ -3822,7 +3822,7 @@ + return; + } + +-#ifdef __linux__ ++#if defined (__linux__) || defined (__FreeBSD__) + gdm_connection_printf (conn, "OK %d\n", gdm_get_cur_vt ()); + #else + gdm_connection_write (conn, "ERROR 8 Virtual terminals not supported\n"); +@@ -3849,7 +3849,7 @@ + return; + } + +-#ifdef __linux__ ++#if defined (__linux__) || defined (__FreeBSD__) + gdm_change_vt (vt); + for (li = displays; li != NULL; li = li->next) { + GdmDisplay *disp = li->data; |