Skip to content

Commit 7cd4bbe

Browse files
oech3cakebaker
authored andcommitted
tests_tail.rs: remove nix
1 parent 1db0a45 commit 7cd4bbe

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

tests/by-util/test_tail.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,16 @@
1313
clippy::cast_possible_truncation
1414
)]
1515

16+
use pretty_assertions::assert_eq;
17+
use rand::distr::Alphanumeric;
18+
use rstest::rstest;
1619
#[cfg(all(
1720
not(target_vendor = "apple"),
1821
not(target_os = "windows"),
1922
not(target_os = "android"),
2023
not(target_os = "freebsd")
2124
))]
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};
3326
use std::char::from_digit;
3427
use std::fs::File;
3528
use std::io::Write;
@@ -790,7 +783,11 @@ fn test_follow_with_pid() {
790783
.stdout_only_fixture("foobar_follow_multiple_appended.expected");
791784

792785
// 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();
794791
let _ = dummy.wait();
795792

796793
child.delay(DEFAULT_SLEEP_INTERVAL_MILLIS);
@@ -2770,7 +2767,11 @@ fn test_fifo_with_pid() {
27702767

27712768
child.make_assertion_with_delay(500).is_alive();
27722769

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();
27742775
let _ = dummy.wait();
27752776

27762777
child

0 commit comments

Comments
 (0)