Set the appropriate ios modes for file operations
Change-Id: If8c4d38f797a855ad7910faaaa5b34f404bad40d
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/libpldmresponder/file_io.cpp b/libpldmresponder/file_io.cpp
index a513f59..12b2864 100644
--- a/libpldmresponder/file_io.cpp
+++ b/libpldmresponder/file_io.cpp
@@ -86,7 +86,7 @@
if (upstream)
{
- std::ifstream stream(path.string());
+ std::ifstream stream(path.string(), std::ios::in | std::ios::binary);
stream.seekg(offset);
// Writing to the VGA memory should be aligned at page boundary,
@@ -126,7 +126,8 @@
if (!upstream)
{
- std::ofstream stream(path.string());
+ std::ofstream stream(path.string(),
+ std::ios::in | std::ios::out | std::ios::binary);
stream.seekp(offset);
stream.write(static_cast<const char*>(vgaMemPtr.get()), length);