File tree Expand file tree Collapse file tree 3 files changed +12
-13
lines changed
crates/libs/kill_tree/src Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,16 @@ pub fn get_available_max_process_id() -> u32 {
74
74
/// This is an error that should not occur under normal circumstances.
75
75
///
76
76
/// ## `InvalidProcEntry`
77
- /// TODO
77
+ /// Returned when inquiry, or parsing within the Linux `/proc/` path fails.
78
+ ///
79
+ /// ## `Io`
80
+ /// Returned when access within the Linux `/proc/` path fails.
81
+ ///
82
+ /// ## `Windows`
83
+ /// Returned when the `Win32` API used internally fails.
84
+ ///
85
+ /// ## `Unix`
86
+ /// Returned when the `libc` API used internally fails.
78
87
pub fn kill_tree ( process_id : ProcessId ) -> Result < Outputs > {
79
88
kill_tree_with_config ( process_id, & Config :: default ( ) )
80
89
}
Original file line number Diff line number Diff line change @@ -19,8 +19,6 @@ pub enum Error {
19
19
Windows ( windows:: core:: Error ) ,
20
20
#[ cfg( unix) ]
21
21
Unix ( nix:: Error ) ,
22
- #[ cfg( feature = "tokio" ) ]
23
- TokioJoin ( :: tokio:: task:: JoinError ) ,
24
22
}
25
23
26
24
impl std:: fmt:: Display for Error {
@@ -46,8 +44,6 @@ impl std::fmt::Display for Error {
46
44
Error :: Windows ( e) => write ! ( f, "Windows error: {e}" ) ,
47
45
#[ cfg( unix) ]
48
46
Error :: Unix ( e) => write ! ( f, "Unix error: {e}" ) ,
49
- #[ cfg( feature = "tokio" ) ]
50
- Error :: TokioJoin ( e) => write ! ( f, "Tokio join error: {e}" ) ,
51
47
}
52
48
}
53
49
}
@@ -139,13 +135,7 @@ pub(crate) mod blocking {
139
135
140
136
#[ cfg( feature = "tokio" ) ]
141
137
pub ( crate ) mod tokio {
142
- use super :: { Error , ProcessInfos , Result } ;
143
-
144
- impl From < :: tokio:: task:: JoinError > for Error {
145
- fn from ( e : :: tokio:: task:: JoinError ) -> Self {
146
- Error :: TokioJoin ( e)
147
- }
148
- }
138
+ use super :: { ProcessInfos , Result } ;
149
139
150
140
pub ( crate ) trait ProcessInfosProvidable {
151
141
async fn get_process_infos ( & self ) -> Result < ProcessInfos > ;
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ pub(crate) mod blocking {
162
162
let status = match std:: fs:: read_to_string ( & status_path) {
163
163
Ok ( x) => x,
164
164
Err ( e) => {
165
- return Err ( Error :: Io ( e ) ) ;
165
+ return Err ( e . into ( ) ) ;
166
166
}
167
167
} ;
168
168
parse_status ( process_id, status_path. display ( ) . to_string ( ) , status)
You can’t perform that action at this time.
0 commit comments