summaryrefslogtreecommitdiffstats
path: root/utils/bcmflash/main.cpp
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-02-23 13:45:30 -0700
committerEvan Lojewski <github@meklort.com>2019-02-23 13:45:30 -0700
commitbfbf9dbba7f1d88e20cbf9ebea3e18f88d645791 (patch)
treed986b5057b85f9fcd6edc86f32c339753be308a9 /utils/bcmflash/main.cpp
parent7331bf61ec148545b4879a692aa2ef3f9eb9dc3e (diff)
downloadbcm5719-ortega-bfbf9dbba7f1d88e20cbf9ebea3e18f88d645791.tar.gz
bcm5719-ortega-bfbf9dbba7f1d88e20cbf9ebea3e18f88d645791.zip
Use save_to_file routine for writing modified fw image.
Diffstat (limited to 'utils/bcmflash/main.cpp')
-rw-r--r--utils/bcmflash/main.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/utils/bcmflash/main.cpp b/utils/bcmflash/main.cpp
index 09a94c5..ae0dfea 100644
--- a/utils/bcmflash/main.cpp
+++ b/utils/bcmflash/main.cpp
@@ -288,17 +288,8 @@ int main(int argc, char const *argv[])
if("file" == options["target"])
{
// write update file.
- fstream outfile;
- outfile.open(options["filename"], fstream::out | fstream::binary);
- if(outfile.is_open())
+ if(!save_to_file(options["filename"].c_str(), (char*)nvram.bytes, NVRAM_SIZE))
{
- outfile.write((char*)nvram.bytes, NVRAM_SIZE);
-
- outfile.close();
- }
- else
- {
- cerr << " Unable to open file '" << options["filename"] << "'" << endl;
exit(-1);
}
}
OpenPOWER on IntegriCloud