diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp index 6acbe7fc..9a857f6c 100644 --- a/spectrum/src/main.cpp +++ b/spectrum/src/main.cpp @@ -243,6 +243,15 @@ int main(int argc, char **argv) return 1; } + // create directories + try { + boost::filesystem::create_directories(CONFIG_STRING(&config, "service.working_dir")); + } + catch (...) { + std::cerr << "Can't create service.working_dir directory " << CONFIG_STRING(&config, "service.working_dir") << ".\n"; + return 1; + } +#ifndef WIN32 // create directories try { boost::filesystem::create_directories( @@ -254,14 +263,6 @@ int main(int argc, char **argv) return 1; } // create directories - try { - boost::filesystem::create_directories(CONFIG_STRING(&config, "service.working_dir")); - } - catch (...) { - std::cerr << "Can't create service.working_dir directory " << CONFIG_STRING(&config, "service.working_dir") << ".\n"; - return 1; - } - // create directories try { boost::filesystem::create_directories( boost::filesystem::path(CONFIG_STRING(&config, "service.portfile")).parent_path().string() @@ -271,6 +272,7 @@ int main(int argc, char **argv) std::cerr << "Can't create service.portfile directory " << CONFIG_STRING(&config, "service.portfile") << ".\n"; return 1; } +#endif #ifdef WIN32 SetCurrentDirectory( utf8ToUtf16(CONFIG_STRING(&config, "service.working_dir")).c_str() );