@@ -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:: fs:: OpenOptionsExt ;
1616use std:: os:: unix:: process:: CommandExt ;
1717use std:: path:: { Path , PathBuf } ;
@@ -40,13 +40,13 @@ enum NohupError {
4040 CannotDetach ,
4141
4242 #[ error( "{}" , translate!( "nohup-error-cannot-replace" , "name" => ( * _0) , "err" => _1) ) ]
43- CannotReplace ( & ' static str , #[ source] Error ) ,
43+ CannotReplace ( & ' static str , #[ source] std :: io :: Error ) ,
4444
4545 #[ error( "{}" , translate!( "nohup-error-open-failed" , "path" => NOHUP_OUT . quote( ) , "err" => _1) ) ]
46- OpenFailed ( i32 , #[ source] Error ) ,
46+ OpenFailed ( i32 , #[ source] std :: io :: Error ) ,
4747
4848 #[ error( "{}" , translate!( "nohup-error-open-failed-both" , "first_path" => NOHUP_OUT . quote( ) , "first_err" => _1, "second_path" => _2. quote( ) , "second_err" => _3) ) ]
49- OpenFailed2 ( i32 , #[ source] Error , String , Error ) ,
49+ OpenFailed2 ( i32 , #[ source] std :: io :: Error , String , std :: io :: Error ) ,
5050}
5151
5252impl UError for NohupError {
@@ -120,18 +120,20 @@ fn replace_fds() -> UResult<()> {
120120 if std:: io:: stdin ( ) . is_terminal ( ) {
121121 let new_stdin = File :: open ( Path :: new ( "/dev/null" ) )
122122 . map_err ( |e| NohupError :: CannotReplace ( "STDIN" , e) ) ?;
123- dup2_stdin ( & new_stdin) . map_err ( |e| NohupError :: CannotReplace ( "STDIN" , Error :: from ( e) ) ) ?;
123+ dup2_stdin ( & new_stdin)
124+ . map_err ( |e| NohupError :: CannotReplace ( "STDIN" , std:: io:: Error :: from ( e) ) ) ?;
124125 }
125126
126127 if std:: io:: stdout ( ) . is_terminal ( ) {
127128 let new_stdout = find_stdout ( ) ?;
128129
129130 dup2_stdout ( & new_stdout)
130- . map_err ( |e| NohupError :: CannotReplace ( "STDOUT" , Error :: from ( e) ) ) ?;
131+ . map_err ( |e| NohupError :: CannotReplace ( "STDOUT" , std :: io :: Error :: from ( e) ) ) ?;
131132 }
132133
133134 if std:: io:: stderr ( ) . is_terminal ( ) {
134- dup2_stderr ( stdout ( ) ) . map_err ( |e| NohupError :: CannotReplace ( "STDERR" , Error :: from ( e) ) ) ?;
135+ dup2_stderr ( stdout ( ) )
136+ . map_err ( |e| NohupError :: CannotReplace ( "STDERR" , std:: io:: Error :: from ( e) ) ) ?;
135137 }
136138 Ok ( ( ) )
137139}
0 commit comments