Skip to content

Commit

Permalink
fuzz: reset the exit code global variable after every test
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Jan 4, 2024
1 parent d07a2f0 commit d8fe220
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuzz/fuzz_targets/fuzz_common.rs
Expand Up @@ -125,6 +125,9 @@ where
let out = s.spawn(|| read_from_fd(pipe_stdout_fds[0]));
let err = s.spawn(|| read_from_fd(pipe_stderr_fds[0]));
let status = uumain_function(args.to_owned().into_iter());
// Reset the exit code global variable in case we run another test after this one
// See https://github.com/uutils/coreutils/issues/5777.
uucore::error::set_exit_code(0);
io::stdout().flush().unwrap();
io::stderr().flush().unwrap();
unsafe {
Expand Down

0 comments on commit d8fe220

Please sign in to comment.