1
0
Fork 0
mirror of https://gitlab.redox-os.org/CoffeeCode/redox-ssh.git synced 2025-12-28 15:02:18 +01:00

Replace deprecated before_exec with pre_exec

> [The `before_exec`] method is stable and usable, but it should be unsafe.
> To fix that, it got deprecated in favor of the unsafe [`pre_exec`].
This commit is contained in:
Laurenz 2024-09-26 13:50:23 +02:00
parent 86f0cc82c3
commit d25d37a751
Signed by: C0ffeeCode
SSH key fingerprint: SHA256:jnEltBNftC3wUZESLSMvM9zVPOkkevGRzqqoW2k2ORI

View file

@ -140,11 +140,13 @@ impl Channel {
.unwrap() .unwrap()
.into_raw_fd(); .into_raw_fd();
process::Command::new("login") unsafe {
.stdin(unsafe { Stdio::from_raw_fd(stdin) }) process::Command::new("login")
.stdout(unsafe { Stdio::from_raw_fd(stdout) }) .stdin(Stdio::from_raw_fd(stdin))
.stderr(unsafe { Stdio::from_raw_fd(stderr) }) .stdout(Stdio::from_raw_fd(stdout))
.before_exec(|| sys::before_exec()) // TODO: listen to compiler warning .stderr(Stdio::from_raw_fd(stderr))
.pre_exec(|| sys::before_exec())
}
.spawn() .spawn()
.unwrap(); .unwrap();
} }