From 67e50a3d470dc379b4b65522f857d057839635a1 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 9 Feb 2015 07:44:45 +0100 Subject: [PATCH] Config sync: Open config files in binary mode fixes #8390 --- lib/remote/apilistener-sync.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/remote/apilistener-sync.cpp b/lib/remote/apilistener-sync.cpp index 51120462b..ec76a16fb 100644 --- a/lib/remote/apilistener-sync.cpp +++ b/lib/remote/apilistener-sync.cpp @@ -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(); } -- 2.40.0