diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp index 6acbe7fc98f1ecd8a10b0b20e020595b78a242e9..9a857f6c95f5fa395a2919410492db267e9ec5b2 100644 --- a/spectrum/src/main.cpp +++ b/spectrum/src/main.cpp @@ -245,20 +245,21 @@ int main(int argc, char **argv) // create directories try { - boost::filesystem::create_directories( - boost::filesystem::path(CONFIG_STRING(&config, "service.pidfile")).parent_path().string() - ); + boost::filesystem::create_directories(CONFIG_STRING(&config, "service.working_dir")); } catch (...) { - std::cerr << "Can't create service.pidfile directory " << boost::filesystem::path(CONFIG_STRING(&config, "service.pidfile")).parent_path().string() << ".\n"; + 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(CONFIG_STRING(&config, "service.working_dir")); + boost::filesystem::create_directories( + boost::filesystem::path(CONFIG_STRING(&config, "service.pidfile")).parent_path().string() + ); } catch (...) { - std::cerr << "Can't create service.working_dir directory " << CONFIG_STRING(&config, "service.working_dir") << ".\n"; + std::cerr << "Can't create service.pidfile directory " << boost::filesystem::path(CONFIG_STRING(&config, "service.pidfile")).parent_path().string() << ".\n"; return 1; } // create directories @@ -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() );