Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions fuzz/uufuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ use rand::RngExt;
use rand::prelude::IndexedRandom;
use rustix::io::dup;
use rustix::io::read;
use rustix::pipe::pipe;
use rustix::stdio::{dup2_stderr, dup2_stdin, dup2_stdout};
use std::env::temp_dir;
use std::ffi::OsString;
use std::fs::File;
use std::io::{Seek, SeekFrom, Write};
use std::io::{pipe, Seek, SeekFrom, Write};
use std::process::{Command, Stdio};
use std::sync::atomic::Ordering;
use std::sync::{Once, atomic::AtomicBool};
Expand Down Expand Up @@ -92,26 +91,8 @@ where
};

println!("Running test {:?}", &args[0..]);
let (read_pipe_stdout, write_pipe_stdout) = match pipe() {
Ok(fds) => fds,
Err(_) => {
return CommandResult {
stdout: "".to_string(),
stderr: "Failed to create pipes".to_string(),
exit_code: -1,
};
}
};
let (read_pipe_stderr, write_pipe_stderr) = match pipe() {
Ok(fds) => fds,
Err(_) => {
return CommandResult {
stdout: "".to_string(),
stderr: "Failed to create pipes".to_string(),
exit_code: -1,
};
}
};
let (read_pipe_stdout, write_pipe_stdout) = pipe().expect("Failed to create pipes");
let (read_pipe_stderr, write_pipe_stderr) = pipe().expect("Failed to create pipes");

// Redirect stdout and stderr to their respective pipes
if dup2_stdout(&write_pipe_stdout).is_err() || dup2_stderr(&write_pipe_stderr).is_err() {
Expand Down
Loading