add status check

This commit is contained in:
2020-05-05 13:43:18 +08:00
parent d2e01d450f
commit 6f3af933c1

View File

@@ -132,6 +132,10 @@ fn ps_aux() -> Option<String> {
return None;
},
};
if !output.status.success() {
print_error(&format!("Run 'ps aux' error: {:?}", output.status));
return None;
}
match String::from_utf8(output.stdout) {
Ok(output_str) => Some(output_str),
Err(err) => {