From c23dbd3166a7839162bc833491ae0b13ce8e1829 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 4 Jan 2024 19:03:30 +0100 Subject: [PATCH] fuzz: reset the exit code global variable after every test --- fuzz/fuzz_targets/fuzz_common.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fuzz/fuzz_targets/fuzz_common.rs b/fuzz/fuzz_targets/fuzz_common.rs index 2a6cbdfded8..0201ffd89c2 100644 --- a/fuzz/fuzz_targets/fuzz_common.rs +++ b/fuzz/fuzz_targets/fuzz_common.rs @@ -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 {