diff --git a/src/main.cpp b/src/main.cpp index 5ed9aa38..e82b59a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -ß#include +#include #include #include #include @@ -29,7 +29,8 @@ using std::vector; //TODO Support files > 4GB //TODO Improve parallelity. -//TODO Seems to deadlock in bonnie++ second run (in the create files sequentially) - maybe also in a later run or different step? +//TODO Did deadlock in bonnie++ second run (in the create files sequentially) - maybe also in a later run or different step? +//TODO Improve error message when root blob wasn't found. void showVersion() { cout << "CryFS Version " << version::VERSION_STRING << endl; @@ -38,6 +39,9 @@ void showVersion() { ". Please do not use in production!" << endl; } else if (!version::IS_STABLE_VERSION) { cout << "WARNING! This is an experimental version. Please backup your data frequently!" << endl; + } else { + //TODO This is shown for stable version numbers like 0.8 - remove once we reach 1.0 + cout << "WARNING! This version is not considered stable. Please backup your data frequently!" << endl; } #ifndef NDEBUG cout << "WARNING! This is a debug build. Performance might be slow." << endl; @@ -47,6 +51,12 @@ void showVersion() { void runFilesystem(const ProgramOptions &options) { auto config = CryConfigLoader().loadOrCreate(bf::path(options.configFile())); + //TODO This daemonize causes error messages when initializing CryDevice to get lost. + // However, initializing CryDevice might (?) already spawn threads and we have to do daemonization before that + // because it doesn't fork threads. What to do? + if (!options.foreground()) { + cpputils::daemonize(); + } auto blockStore = make_unique_ref(bf::path(options.baseDir())); CryDevice device(std::move(config), std::move(blockStore)); fspp::FilesystemImpl fsimpl(&device); @@ -61,10 +71,6 @@ int main(int argc, char *argv[]) { showVersion(); ProgramOptions options = program_options::Parser(argc, argv).parse(); - if (!options.foreground()) { - cpputils::daemonize(); - } - runFilesystem(options); return 0; }