From 14e450f7b5a8ff71f4ae27c59860f2439b3a7b2d Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Tue, 4 Sep 2012 16:07:32 +0200 Subject: [PATCH] Do not create pidfile and portfile directories on windows --- spectrum/src/main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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() );