summaryrefslogtreecommitdiffstats
path: root/x11/gdm/files/patch-daemon_getvt.c
blob: 25bdebead2fdfc67680ab4bfdb87c12df3c81f1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--- daemon/getvt.c.orig 2007-07-11 13:06:10.000000000 -0400
+++ daemon/getvt.c  2007-07-11 13:13:29.000000000 -0400
@@ -102,6 +102,27 @@ gdm_get_current_vtnum (Display *display)
    return num;
 }
 
+#if defined (GDM_USE_SYS_VT)
+#include <sys/vt.h>
+#elif defined (GDM_USE_CONSIO_VT)
+#include <sys/consio.h>
+
+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
+
+
 gchar *
 gdm_get_vt_device (int vtno)
 {
@@ -128,25 +149,6 @@ gdm_get_vt_device (int vtno)
 #define GDMCONSOLEDEVICE "/dev/console"
 #endif
 
-#if defined (GDM_USE_SYS_VT)
-#include <sys/vt.h>
-#elif defined (GDM_USE_CONSIO_VT)
-#include <sys/consio.h>
-
-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)