Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

refactor: remove coredump dir which is useless #1030

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/dsn/tool-api/global_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ struct service_spec
std::vector<service_app_spec> app_specs;

// auto-set
std::string dir_coredump;
std::string dir_log;

service_spec() {}
Expand Down
5 changes: 1 addition & 4 deletions src/runtime/service_api_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,7 @@ bool run(const char *config_file,
}
spec.data_dir = cdir;

// setup coredump dir
spec.dir_coredump = ::dsn::utils::filesystem::path_combine(cdir, "coredumps");
dsn::utils::filesystem::create_directory(spec.dir_coredump);
::dsn::utils::coredump::init(spec.dir_coredump.c_str());
::dsn::utils::coredump::init();

// setup log dir
spec.dir_log = ::dsn::utils::filesystem::path_combine(cdir, "log");
Expand Down
6 changes: 3 additions & 3 deletions src/utils/coredump.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ namespace utils {
class coredump
{
public:
static void init(const char *dump_dir);
static void init();
static void write();
};
}
}
} // namespace utils
} // namespace dsn
5 changes: 1 addition & 4 deletions src/utils/coredump.posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,11 @@
namespace dsn {
namespace utils {

static std::string s_dump_dir;
static void handle_core_dump(int);
static void handle_term(int);

void coredump::init(const char *dump_dir)
void coredump::init()
{
s_dump_dir = dump_dir;

signal(SIGSEGV, handle_core_dump);
signal(SIGTERM, handle_term);
}
Expand Down