mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
Merge pull request #2234 from chadbrewbaker/fix-cat-random-timeout
dev random blocks on linux
This commit is contained in:
commit
b9e99543db
1 changed files with 7 additions and 1 deletions
|
@ -347,7 +347,13 @@ fn test_squeeze_blank_before_numbering() {
|
|||
#[cfg(unix)]
|
||||
fn test_dev_random() {
|
||||
let mut buf = [0; 2048];
|
||||
let mut proc = new_ucmd!().args(&["/dev/random"]).run_no_wait();
|
||||
#[cfg(target_os = "linux")]
|
||||
const DEV_RANDOM: &str = "/dev/urandom";
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
const DEV_RANDOM: &str = "/dev/random";
|
||||
|
||||
let mut proc = new_ucmd!().args(&[DEV_RANDOM]).run_no_wait();
|
||||
let mut proc_stdout = proc.stdout.take().unwrap();
|
||||
proc_stdout.read_exact(&mut buf).unwrap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue