Skip to content

Commit

Permalink
Merge pull request #4252 from Champ-Goblem/patch/fix-is-signal-handled
Browse files Browse the repository at this point in the history
agent: Fix is_signal_handled failing parsing str to u64
  • Loading branch information
cmaf committed May 17, 2022
2 parents 12f0ab1 + 4b437d9 commit 04bd8f1
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/agent/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ fn is_signal_handled(proc_status_file: &str, signum: u32) -> bool {
warn!(sl!(), "parse the SigCgt field failed");
return false;
}
let sig_cgt_str = mask_vec[1];
let sig_cgt_str = mask_vec[1].trim();
let sig_cgt_mask = match u64::from_str_radix(sig_cgt_str, 16) {
Ok(h) => h,
Err(_) => {
Expand Down Expand Up @@ -2453,6 +2453,26 @@ OtherField:other
signum: 4,
result: true,
},
TestData {
status_file_data: Some("SigCgt:\t000000004b813efb"),
signum: 4,
result: true,
},
TestData {
status_file_data: Some("SigCgt: 000000004b813efb"),
signum: 4,
result: true,
},
TestData {
status_file_data: Some("SigCgt:000000004b813efb "),
signum: 4,
result: true,
},
TestData {
status_file_data: Some("SigCgt:\t000000004b813efb "),
signum: 4,
result: true,
},
TestData {
status_file_data: Some("SigCgt:000000004b813efb"),
signum: 3,
Expand Down

0 comments on commit 04bd8f1

Please sign in to comment.