Config sync: Open config files in binary mode

fixes #8390
This commit is contained in:
Gunnar Beutner 2015-02-09 07:44:45 +01:00
parent e456cfd99c
commit 67e50a3d47
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ void ApiListener::ConfigGlobHandler(Dictionary::Ptr& config, const String& path,
Log(LogNotice, "ApiListener")
<< "Creating config update for file '" << file << "'";
std::ifstream fp(file.CStr());
std::ifstream fp(file.CStr(), std::ifstream::binary);
if (!fp)
return;
@ -81,7 +81,7 @@ bool ApiListener::UpdateConfigDir(const Dictionary::Ptr& oldConfig, const Dictio
//pass the directory and generate a dir tree, if not existing already
Utility::MkDirP(Utility::DirName(path), 0755);
std::ofstream fp(path.CStr(), std::ofstream::out | std::ostream::trunc);
std::ofstream fp(path.CStr(), std::ofstream::out | std::ostream::binary | std::ostream::trunc);
fp << kv.second;
fp.close();
}