souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
50 static std::mutex outputMutex;
51 static bool sameLine =
false;
52 std::lock_guard<std::mutex> guard(outputMutex);
53 if (
msg !=
nullptr && strcmp(
m,
msg) == 0) {
59 std::cout << std::endl;
61 std::string outputMessage(
m);
62 for (
char& c : outputMessage) {
63 if (c ==
'\n' || c ==
'\t') {
67 std::cout <<
"Starting work on " << outputMessage << std::endl;
77 if (!
isSet && std::getenv(
"SOUFFLE_ALLOW_SIGNALS") ==
nullptr) {
81 perror(
"Failed to set SIGFPE signal handler.");
86 perror(
"Failed to set SIGINT signal handler.");
91 perror(
"Failed to set SIGSEGV signal handler.");
105 perror(
"Failed to reset SIGFPE signal handler.");
110 perror(
"Failed to reset SIGINT signal handler.");
115 perror(
"Failed to reset SIGSEGV signal handler.");
127 if (
msg !=
nullptr) {
128 std::cerr <<
error <<
" in rule:\n" <<
msg << std::endl;
130 std::cerr <<
error << std::endl;
137 std::atomic<const char*>
msg;
156 case SIGINT:
error =
"Interrupt";
break;
157 case SIGFPE:
error =
"Floating-point arithmetic exception";
break;
158 case SIGSEGV:
error =
"Segmentation violation";
break;
161 if (
msg !=
nullptr) {
162 std::cerr <<
error <<
" signal in rule:\n" <<
msg << std::endl;
164 std::cerr <<
error <<
" signal." << std::endl;
void error(const std::string &error)
void setMsg(const char *m)
void(* prevIntHandler)(int)
std::atomic< const char * > msg
static void handler(int signal)
Signal handler for various types of signals.
void(* prevFpeHandler)(int)
static SignalHandler * instance()
void(* prevSegVHandler)(int)