mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
Signed-off-by: iko1 <me@remotecpp.dev>
This commit is contained in:
parent
2b0869c16d
commit
7adf80fccd
1 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
|
||||
// Copyright 2022, Roman Gershman. All rights reserved.
|
||||
// See LICENSE for licensing terms.
|
||||
//
|
||||
|
@ -6,6 +7,7 @@
|
|||
#include <mimalloc-new-delete.h>
|
||||
#endif
|
||||
|
||||
#include <signal.h>
|
||||
#include <liburing.h>
|
||||
#include <absl/flags/usage.h>
|
||||
#include <absl/flags/usage_config.h>
|
||||
|
@ -137,6 +139,13 @@ extern "C" void _mi_options_init();
|
|||
|
||||
using namespace dfly;
|
||||
|
||||
void sigill_hdlr(int signo) {
|
||||
LOG(ERROR)
|
||||
<< "An attempt to execute an instruction failed."
|
||||
<< "The root cause might be an old hardware. Exiting...";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
absl::SetProgramUsageMessage(
|
||||
R"(a modern in-memory store.
|
||||
|
@ -157,6 +166,11 @@ Usage: dragonfly [FLAGS]
|
|||
|
||||
MainInitGuard guard(&argc, &argv);
|
||||
|
||||
struct sigaction act;
|
||||
act.sa_handler = sigill_hdlr;
|
||||
sigemptyset(&act.sa_mask);
|
||||
sigaction(SIGILL, &act, nullptr);
|
||||
|
||||
CHECK_GT(GetFlag(FLAGS_port), 0u);
|
||||
mi_stats_reset();
|
||||
|
||||
|
|
Loading…
Reference in a new issue