Do not create pidfile and portfile directories on windows

This commit is contained in:
Jan Kaluza 2012-09-04 16:07:32 +02:00
parent f219bf6320
commit 14e450f7b5

View file

@ -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() );