diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp --- a/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp @@ -11,6 +11,7 @@ #if LIBFUZZER_LINUX || LIBFUZZER_NETBSD || LIBFUZZER_FREEBSD || \ LIBFUZZER_EMSCRIPTEN #include "FuzzerCommand.h" +#include "FuzzerOptions.h" #include #include @@ -23,8 +24,11 @@ int ExecuteCommand(const Command &Cmd) { std::string CmdLine = Cmd.toString(); int exit_code = system(CmdLine.c_str()); - if (WIFEXITED(exit_code)) + if (WIFEXITED(exit_code)){ return WEXITSTATUS(exit_code); + } else if (WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGINT) { + return FuzzingOptions->InterruptExitCode; + } return exit_code; }