terminal: Rename set_kdmode to kd_setmode

This commit is contained in:
Kenny Levinsen
2020-01-07 01:29:55 +01:00
parent 8e88b058a0
commit 231f11e43b
2 changed files with 5 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ impl<'a> Session<'a> {
// Set the target VT mode to text for compatibility. Other login // Set the target VT mode to text for compatibility. Other login
// managers set this to graphics, but that disallows start of textual // managers set this to graphics, but that disallows start of textual
// applications, which greetd aims to support. // applications, which greetd aims to support.
target_term.set_kdmode(terminal::KdMode::Text)?; target_term.kd_setmode(terminal::KdMode::Text)?;
// A bit more work if a VT switch is required. // A bit more work if a VT switch is required.
if self.vt != target_term.vt_get_current()? { if self.vt != target_term.vt_get_current()? {

View File

@@ -19,7 +19,7 @@ const VT_WAITACTIVE: u16 = 0x5607;
const VT_SETACTIVATE: u16 = 0x560F; const VT_SETACTIVATE: u16 = 0x560F;
const VT_AUTO: u8 = 0; const VT_AUTO: u8 = 0;
ioctl_write_int_bad!(vt_kdsetmode, KDSETMODE); ioctl_write_int_bad!(kd_setmode, KDSETMODE);
ioctl_write_int_bad!(vt_activate, VT_ACTIVATE); ioctl_write_int_bad!(vt_activate, VT_ACTIVATE);
ioctl_write_int_bad!(vt_waitactive, VT_WAITACTIVE); ioctl_write_int_bad!(vt_waitactive, VT_WAITACTIVE);
ioctl_write_ptr_bad!(vt_setmode, VT_SETMODE, vt_mode); ioctl_write_ptr_bad!(vt_setmode, VT_SETMODE, vt_mode);
@@ -70,7 +70,7 @@ impl KdMode {
pub fn restore(terminal: usize) -> Result<(), Box<dyn Error>> { pub fn restore(terminal: usize) -> Result<(), Box<dyn Error>> {
let tty_0 = Terminal::open(0)?; let tty_0 = Terminal::open(0)?;
let tty_x = Terminal::open(terminal)?; let tty_x = Terminal::open(terminal)?;
tty_x.set_kdmode(KdMode::Text)?; tty_x.kd_setmode(KdMode::Text)?;
tty_0.vt_setactivate(terminal)?; tty_0.vt_setactivate(terminal)?;
Ok(()) Ok(())
} }
@@ -96,9 +96,9 @@ impl Terminal {
} }
} }
pub fn set_kdmode(&self, mode: KdMode) -> Result<(), Box<dyn Error>> { pub fn kd_setmode(&self, mode: KdMode) -> Result<(), Box<dyn Error>> {
let mode = mode.to_const(); let mode = mode.to_const();
let ret = unsafe { vt_kdsetmode(self.fd, mode) }; let ret = unsafe { kd_setmode(self.fd, mode) };
if let Err(v) = ret { if let Err(v) = ret {
Err(format!("terminal: unable to set kernel display mode: {}", v).into()) Err(format!("terminal: unable to set kernel display mode: {}", v).into())