diff --git a/src/checks.h b/src/checks.h index 9673de3..f981965 100644 --- a/src/checks.h +++ b/src/checks.h @@ -17,6 +17,8 @@ #include "sqlite.h" +constexpr std::string_view DB_FILENAME = "s3gw.db"; + /* Fix - This is an abstract datatype representing an executable action to fix * an incosistency in the filesystem or metadata database. */ @@ -51,7 +53,7 @@ class Check { : check_name(name), fatality(f), root_path(path), - metadata(std::make_unique(path / "s3gw.db")) {} + metadata(std::make_unique(path / DB_FILENAME)) {} virtual ~Check(){}; enum LogLevel { SILENT, NORMAL, VERBOSE }; bool check(LogLevel log_level = NORMAL); diff --git a/src/main.cc b/src/main.cc index 86596d7..bf20037 100644 --- a/src/main.cc +++ b/src/main.cc @@ -66,9 +66,7 @@ int main(int argc, char* argv[]) { std::string path_str(options_map["path"].as()); std::filesystem::path path_root(path_str); - std::filesystem::path path_database = path_root / "s3gw.db"; - std::filesystem::path path_database_shm = path_root / "s3gw.db_tmp-shm"; - std::filesystem::path path_database_wal = path_root / "s3gw.db-wal"; + std::filesystem::path path_database = path_root / DB_FILENAME; FSCK_ASSERT(std::filesystem::exists(path_root), "Path not found"); FSCK_ASSERT(