changes error reporting and exit value to properly communicate issues

This commit is contained in:
2026-03-20 12:28:42 +01:00
parent a3c66ee744
commit e67d7b4301

View File

@@ -154,10 +154,11 @@ int sc_main(int argc, char* argv[]) {
case SIGTERM:
case SIGUSR1:
case SIGUSR2:
SCCINFO() << "Simulation stopped with signal " << res << ".";
sc_core::sc_stop();
SCCINFO() << "Simulation stopped with signal " << sigabbrev_np(res) << ".";
break;
default:
SCCERR() << "Simulation aborted with signal " << res << "!";
SCCERR() << "Simulation aborted with signal " << sigabbrev_np(res) << "!";
}
} else {
try {
@@ -171,5 +172,5 @@ int sc_main(int argc, char* argv[]) {
sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);
}
}
return 0;
return sc_core::sc_report_handler::get_count(SC_ERROR) + sc_core::sc_report_handler::get_count(SC_WARNING);
}