|
13 | 13 | clippy::cast_possible_truncation |
14 | 14 | )] |
15 | 15 |
|
| 16 | +use pretty_assertions::assert_eq; |
| 17 | +use rand::distr::Alphanumeric; |
| 18 | +use rstest::rstest; |
16 | 19 | #[cfg(all( |
17 | 20 | not(target_vendor = "apple"), |
18 | 21 | not(target_os = "windows"), |
19 | 22 | not(target_os = "android"), |
20 | 23 | not(target_os = "freebsd") |
21 | 24 | ))] |
22 | | -use nix::sys::signal::{Signal, kill}; |
23 | | -#[cfg(all( |
24 | | - not(target_vendor = "apple"), |
25 | | - not(target_os = "windows"), |
26 | | - not(target_os = "android"), |
27 | | - not(target_os = "freebsd") |
28 | | -))] |
29 | | -use nix::unistd::Pid; |
30 | | -use pretty_assertions::assert_eq; |
31 | | -use rand::distr::Alphanumeric; |
32 | | -use rstest::rstest; |
| 25 | +use rustix::process::{Pid, Signal, kill_process}; |
33 | 26 | use std::char::from_digit; |
34 | 27 | use std::fs::File; |
35 | 28 | use std::io::Write; |
@@ -790,7 +783,11 @@ fn test_follow_with_pid() { |
790 | 783 | .stdout_only_fixture("foobar_follow_multiple_appended.expected"); |
791 | 784 |
|
792 | 785 | // kill the dummy process and give tail time to notice this |
793 | | - kill(Pid::from_raw(i32::try_from(pid).unwrap()), Signal::SIGUSR1).unwrap(); |
| 786 | + kill_process( |
| 787 | + Pid::from_raw(i32::try_from(pid).unwrap()).unwrap(), |
| 788 | + Signal::USR1, |
| 789 | + ) |
| 790 | + .unwrap(); |
794 | 791 | let _ = dummy.wait(); |
795 | 792 |
|
796 | 793 | child.delay(DEFAULT_SLEEP_INTERVAL_MILLIS); |
@@ -2770,7 +2767,11 @@ fn test_fifo_with_pid() { |
2770 | 2767 |
|
2771 | 2768 | child.make_assertion_with_delay(500).is_alive(); |
2772 | 2769 |
|
2773 | | - kill(Pid::from_raw(i32::try_from(pid).unwrap()), Signal::SIGUSR1).unwrap(); |
| 2770 | + kill_process( |
| 2771 | + Pid::from_raw(i32::try_from(pid).unwrap()).unwrap(), |
| 2772 | + Signal::USR1, |
| 2773 | + ) |
| 2774 | + .unwrap(); |
2774 | 2775 | let _ = dummy.wait(); |
2775 | 2776 |
|
2776 | 2777 | child |
|
0 commit comments