View | Details | Raw Unified | Return to bug 277114
Collapse All | Expand All

(-)b/x11/lightdm/Makefile (-1 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	lightdm
1
PORTNAME=	lightdm
2
PORTVERSION=	1.32.0
2
PORTVERSION=	1.32.0
3
PORTREVISION=	3
3
PORTREVISION=	4
4
CATEGORIES=	x11
4
CATEGORIES=	x11
5
MASTER_SITES=	https://github.com/canonical/${PORTNAME}/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/
5
MASTER_SITES=	https://github.com/canonical/${PORTNAME}/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/
6
6
(-)b/x11/lightdm/files/patch-src_x-server.c (-6 / +54 lines)
Lines 1-15 Link Here
1
--- src/x-server.c.orig	2018-08-30 00:28:55 UTC
1
--- src/x-server.c.orig	2019-08-04 22:29:55 UTC
2
+++ src/x-server.c
2
+++ src/x-server.c
3
@@ -152,10 +152,10 @@ x_server_connect_session (DisplayServer *display_serve
3
@@ -152,13 +152,60 @@ x_server_connect_session (DisplayServer *display_serve
4
         g_autofree gchar *tty_text = NULL;
4
         g_autofree gchar *tty_text = NULL;
5
         g_autofree gchar *vt_text = NULL;
5
         g_autofree gchar *vt_text = NULL;
6
 
6
 
7
-        tty_text = g_strdup_printf ("/dev/tty%d", vt);
7
+#ifdef __FreeBSD__
8
+        tty_text = g_strdup_printf ("/dev/ttyv%d", vt - 1);
8
+        char vty_num32[6];
9
+        int num;
10
+        const int base = 32;
11
+        size_t offset = 0;
12
+
13
+        num = vt - 1;
14
+
15
+        if (num == 0) {
16
+            vty_num32[offset++] = '0';
17
+            vty_num32[offset] = '\0';
18
+        } else {
19
+            for (int remaning = num; remaning > 0; remaning /= base, offset++) {
20
+                if (offset + 1 >= 6) {
21
+                    g_error ("tty number buffer too small");
22
+                    goto error;
23
+                }
24
+
25
+                const int value = remaning % base;
26
+                if (value >= 10) {
27
+                    vty_num32[offset] = 'a' + value - 10;
28
+                } else {
29
+                    vty_num32[offset] = '0' + value;
30
+                }
31
+            }
32
+
33
+            for (size_t i = 0; i < offset / 2; i++) {
34
+                const size_t p1 = i;
35
+                const size_t p2 = offset - 1 - i;
36
+                const char tmp = vty_num32[p1];
37
+                vty_num32[p1] = vty_num32[p2];
38
+                vty_num32[p2] = tmp;
39
+            }
40
+
41
+            vty_num32[offset] = '\0';
42
+        }
43
+
44
+        tty_text = g_strdup_printf ("/dev/ttyv%s", vty_num32);
45
+#else
46
         tty_text = g_strdup_printf ("/dev/tty%d", vt);
47
+#endif
9
         session_set_tty (session, tty_text);
48
         session_set_tty (session, tty_text);
10
 
49
 
11
-        vt_text = g_strdup_printf ("%d", vt);
50
+#ifdef __FreeBSD__
12
+        vt_text = g_strdup_printf ("%d", vt - 1);
51
+        vt_text = g_strdup_printf ("%d", num);
52
+#else
53
         vt_text = g_strdup_printf ("%d", vt);
54
+#endif
13
         session_set_env (session, "XDG_VTNR", vt_text);
55
         session_set_env (session, "XDG_VTNR", vt_text);
14
     }
56
     }
15
     else
57
     else
58
+#ifdef __FreeBSD__
59
+error:
60
+#endif
61
         l_debug (session, "Not setting XDG_VTNR");
62
 
63
     session_set_env (session, "DISPLAY", x_server_get_address (X_SERVER (display_server)));

Return to bug 277114