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 cd12337f2a
commit d4d42cae0d

View File

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