Revert "su: allocate new pty (#1693)"

This reverts commit 935dc18faa.
This commit is contained in:
weishu
2024-05-08 21:17:24 +08:00
parent 98757bcdb3
commit a3df721b84
7 changed files with 2 additions and 236 deletions

View File

@@ -1,5 +1,4 @@
use anyhow::{anyhow, bail, Ok, Result};
use std::fs::create_dir;
#[cfg(any(target_os = "linux", target_os = "android"))]
use anyhow::Context;
@@ -182,19 +181,6 @@ pub fn mount_tmpfs(dest: impl AsRef<Path>) -> Result<()> {
Ok(())
}
#[cfg(any(target_os = "linux", target_os = "android"))]
pub fn mount_devpts(dest: impl AsRef<Path>) -> Result<()> {
create_dir(dest.as_ref())?;
mount(
KSU_OVERLAY_SOURCE,
dest.as_ref(),
"devpts",
MountFlags::empty(),
"newinstance",
)?;
Ok(())
}
#[cfg(any(target_os = "linux", target_os = "android"))]
pub fn bind_mount(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
info!(
@@ -339,8 +325,3 @@ pub fn mount_overlay(
pub fn mount_tmpfs(_dest: impl AsRef<Path>) -> Result<()> {
unimplemented!()
}
#[cfg(not(any(target_os = "linux", target_os = "android")))]
pub fn mount_devpts(_dest: impl AsRef<Path>) -> Result<()> {
unimplemented!()
}