@@ -11,7 +11,7 @@ use clap::{Arg, ArgAction, Command};
1111use rustix:: stdio:: { dup2_stderr, dup2_stdin, dup2_stdout, stdout} ;
1212use std:: env;
1313use std:: fs:: { File , OpenOptions } ;
14- use std:: io:: { Error , ErrorKind , IsTerminal } ;
14+ use std:: io:: { ErrorKind , IsTerminal } ;
1515use std:: os:: unix:: process:: CommandExt ;
1616use std:: path:: { Path , PathBuf } ;
1717use std:: process;
@@ -39,13 +39,13 @@ enum NohupError {
3939 CannotDetach ,
4040
4141 #[ error( "{}" , translate!( "nohup-error-cannot-replace" , "name" => ( * _0) , "err" => _1) ) ]
42- CannotReplace ( & ' static str , #[ source] Error ) ,
42+ CannotReplace ( & ' static str , #[ source] std :: io :: Error ) ,
4343
4444 #[ error( "{}" , translate!( "nohup-error-open-failed" , "path" => NOHUP_OUT . quote( ) , "err" => _1) ) ]
45- OpenFailed ( i32 , #[ source] Error ) ,
45+ OpenFailed ( i32 , #[ source] std :: io :: Error ) ,
4646
4747 #[ error( "{}" , translate!( "nohup-error-open-failed-both" , "first_path" => NOHUP_OUT . quote( ) , "first_err" => _1, "second_path" => _2. quote( ) , "second_err" => _3) ) ]
48- OpenFailed2 ( i32 , #[ source] Error , String , Error ) ,
48+ OpenFailed2 ( i32 , #[ source] std :: io :: Error , String , std :: io :: Error ) ,
4949}
5050
5151impl UError for NohupError {
@@ -119,18 +119,20 @@ fn replace_fds() -> UResult<()> {
119119 if std:: io:: stdin ( ) . is_terminal ( ) {
120120 let new_stdin = File :: open ( Path :: new ( "/dev/null" ) )
121121 . map_err ( |e| NohupError :: CannotReplace ( "STDIN" , e) ) ?;
122- dup2_stdin ( & new_stdin) . map_err ( |e| NohupError :: CannotReplace ( "STDIN" , Error :: from ( e) ) ) ?;
122+ dup2_stdin ( & new_stdin)
123+ . map_err ( |e| NohupError :: CannotReplace ( "STDIN" , std:: io:: Error :: from ( e) ) ) ?;
123124 }
124125
125126 if std:: io:: stdout ( ) . is_terminal ( ) {
126127 let new_stdout = find_stdout ( ) ?;
127128
128129 dup2_stdout ( & new_stdout)
129- . map_err ( |e| NohupError :: CannotReplace ( "STDOUT" , Error :: from ( e) ) ) ?;
130+ . map_err ( |e| NohupError :: CannotReplace ( "STDOUT" , std :: io :: Error :: from ( e) ) ) ?;
130131 }
131132
132133 if std:: io:: stderr ( ) . is_terminal ( ) {
133- dup2_stderr ( stdout ( ) ) . map_err ( |e| NohupError :: CannotReplace ( "STDERR" , Error :: from ( e) ) ) ?;
134+ dup2_stderr ( stdout ( ) )
135+ . map_err ( |e| NohupError :: CannotReplace ( "STDERR" , std:: io:: Error :: from ( e) ) ) ?;
134136 }
135137 Ok ( ( ) )
136138}
0 commit comments