Skip to content

Commit 5456698

Browse files
cepelinas9000tautvis
authored andcommitted
Patch 4/6 os-support: add xf86VTKeepTtyIsSet
Add xf86VTKeepTtyIsSet function to export KeepTty state. When seatd activates, it takes control of current vt (in global sense)!, this code only activates sesion control code when XServer started using same vt (for more context see c88a325 commit ). Signed-off-By: Tautvis <[email protected]>
1 parent 9a6121e commit 5456698

File tree

8 files changed

+37
-4
lines changed

8 files changed

+37
-4
lines changed

hw/xfree86/os-support/bsd/bsd_init.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ static xf86ConsOpen_t xf86ConsTab[] = {
134134
(xf86ConsOpen_t) NULL
135135
};
136136

137+
138+
Bool
139+
xf86VTKeepTtyIsSet(void)
140+
{
141+
return KeepTty;
142+
}
143+
137144
void
138145
xf86OpenConsole(void)
139146
{

hw/xfree86/os-support/hurd/hurd_init.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ xf86UseMsg()
5757
return;
5858
}
5959

60+
Bool
61+
xf86VTKeepTtyIsSet(void)
62+
{
63+
return FALSE;
64+
}
65+
6066
void
6167
xf86OpenConsole()
6268
{

hw/xfree86/os-support/linux/linux.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@
2727
#define XF86_LINUX_H
2828

2929
int linux_parse_vt_settings(int may_fail);
30-
int linux_get_keeptty(void);
3130

3231
#endif

hw/xfree86/os-support/linux/lnx_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ linux_parse_vt_settings(int may_fail)
167167
return 1;
168168
}
169169

170-
int
171-
linux_get_keeptty(void)
170+
Bool
171+
xf86VTKeepTtyIsSet(void)
172172
{
173173
return KeepTty;
174174
}

hw/xfree86/os-support/linux/systemd-logind.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ static struct dbus_core_hook core_hook = {
659659
int
660660
systemd_logind_init(void)
661661
{
662-
if (!ServerIsNotSeat0() && xf86HasTTYs() && linux_parse_vt_settings(TRUE) && !linux_get_keeptty()) {
662+
if (!ServerIsNotSeat0() && xf86HasTTYs() && linux_parse_vt_settings(TRUE) && !xf86VTKeepTtyIsSet()) {
663663
LogMessage(X_INFO,
664664
"systemd-logind: logind integration requires -keeptty and "
665665
"-keeptty was not provided, disabling logind integration\n");

hw/xfree86/os-support/solaris/sun_init.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ static char consoleDev[PATH_MAX] = "/dev/fb";
7474
Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
7575
char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
7676

77+
78+
Bool
79+
xf86VTKeepTtyIsSet(void)
80+
{
81+
return KeepTty;
82+
}
83+
84+
7785
#ifdef HAS_USL_VTS
7886
static void
7987
switch_to(int vt, const char *from)

hw/xfree86/os-support/stub/stub_init.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ xf86CloseConsole(void)
1515
{
1616
}
1717

18+
Bool
19+
xf86VTKeepTtyIsSet(void)
20+
{
21+
return FALSE;
22+
}
23+
24+
1825
int
1926
xf86ProcessArgument(int argc, char *argv[], int i)
2027
{

hw/xfree86/os-support/xf86_os_support.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ typedef void (*PMClose) (void);
3030

3131
void xf86OpenConsole(void);
3232
void xf86CloseConsole(void);
33+
34+
/**
35+
* @brief get keeptty switch state
36+
**/
37+
Bool xf86VTKeepTtyIsSet(void);
38+
3339
Bool xf86VTActivate(int vtno);
3440
Bool xf86VTSwitchPending(void);
3541
Bool xf86VTSwitchAway(void);

0 commit comments

Comments
 (0)