Introduce a new cmake option that allows graceful shutdown in case of options
parent
9ff81ed021
commit
4f8d79f3a2
|
@ -565,6 +565,12 @@ IF (DISABLE_MEMMANAGER)
|
||||||
ADD_DEFINITIONS(-DIM_DISABLE)
|
ADD_DEFINITIONS(-DIM_DISABLE)
|
||||||
ENDIF (DISABLE_MEMMANAGER)
|
ENDIF (DISABLE_MEMMANAGER)
|
||||||
|
|
||||||
|
OPTION(EXIT_ON_EXCEPTION "Thrown exceptions in VERMONT result in a graceful shutdown. Useful for fuzz testing only." OFF)
|
||||||
|
MARK_AS_ADVANCED(EXIT_ON_EXCEPTION)
|
||||||
|
IF (EXIT_ON_EXCEPTION)
|
||||||
|
ADD_DEFINITIONS(-DEXIT_ON_EXCEPTION)
|
||||||
|
ENDIF(EXIT_ON_EXCEPTION)
|
||||||
|
|
||||||
|
|
||||||
### IPFIXLOLIB_RAWDIR_SUPPORT
|
### IPFIXLOLIB_RAWDIR_SUPPORT
|
||||||
|
|
||||||
|
|
|
@ -334,7 +334,11 @@ extern "C" {
|
||||||
msg_expand(text, line, filename, funcname, simplefunc, LOG_CRIT, fmt, &args);
|
msg_expand(text, line, filename, funcname, simplefunc, LOG_CRIT, fmt, &args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
|
#ifdef EXIT_ON_EXCEPTION
|
||||||
|
exit(0);
|
||||||
|
#else
|
||||||
throw std::runtime_error(text);
|
throw std::runtime_error(text);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in New Issue