Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for end of line issue on Windows #2515

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ boost::optional<DbRecord> PlainTextDb::FindRecordUnsafe(const std::string& key,

MIOPEN_LOG_I2("Looking for key " << key << " in file " << filename);

std::ifstream file(filename);
std::ifstream file(filename, std::ios::binary);

if(!file)
{
Expand Down Expand Up @@ -242,7 +242,7 @@ bool PlainTextDb::FlushUnsafe(const DbRecord& record, const RecordPositions* pos
if(pos->begin < 0 || pos->end < 0)
{
{
std::ofstream file(filename, std::ios::app);
std::ofstream file(filename, std::ios::app | std::ios::binary);

if(!file)
{
Expand All @@ -258,7 +258,7 @@ bool PlainTextDb::FlushUnsafe(const DbRecord& record, const RecordPositions* pos
}
else
{
std::ifstream from(filename, std::ios::ate);
std::ifstream from(filename, std::ios::ate | std::ios::binary);

if(!from)
{
Expand All @@ -267,7 +267,7 @@ bool PlainTextDb::FlushUnsafe(const DbRecord& record, const RecordPositions* pos
}

const auto temp_name = filename + ".temp";
std::ofstream to(temp_name);
std::ofstream to(temp_name, std::ios::binary);

if(!to)
{
Expand Down