ksud: Remove warning for non-tty std

This commit is contained in:
Wang Han
2025-11-29 00:45:15 +08:00
committed by 生于生时 亡于亡刻
parent 9e65012c99
commit ed7b41545a

View File

@@ -5,7 +5,7 @@ use crate::{
use anyhow::{Context, Ok, Result, bail};
use getopts::Options;
use libc::c_int;
use log::{error, warn};
use log::error;
#[cfg(unix)]
use std::os::unix::process::CommandExt;
use std::{
@@ -75,7 +75,6 @@ fn set_identity(uid: u32, gid: u32, groups: &[u32]) {
fn wrap_tty(fd: c_int) {
let inner_fn = move || -> Result<()> {
if unsafe { libc::isatty(fd) != 1 } {
warn!("not a tty: {fd}");
return Ok(());
}
let new_fd = get_wrapped_fd(fd).context("get_wrapped_fd")?;