[coreboot] New patch to review for coreboot: 3a197f7 nvramtool: Read/write binary data as binary

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Tue Sep 25 11:05:21 CEST 2012


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1535

-gerrit

commit 3a197f70f91986ae971355917870cc3c4d07be4d
Author: Patrick Georgi <patrick.georgi at secunet.com>
Date:   Thu Sep 20 13:26:42 2012 +0200

    nvramtool: Read/write binary data as binary
    
    Only relevant on windows (and nvramtool currently fails there), but
    it doesn't hurt.
    
    Change-Id: I5d6420c1f9dc49cf3af31e75088e51a90f729e01
    Signed-off-by: Patrick Georgi <patrick.georgi at secunet.com>
---
 util/nvramtool/cli/nvramtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/nvramtool/cli/nvramtool.c b/util/nvramtool/cli/nvramtool.c
index f3fb16d..f283463 100644
--- a/util/nvramtool/cli/nvramtool.c
+++ b/util/nvramtool/cli/nvramtool.c
@@ -402,7 +402,7 @@ static void op_write_cmos_dump(void)
 	unsigned char data[CMOS_SIZE];
 	FILE *f;
 
-	if ((f = fopen(nvramtool_op.param, "w")) == NULL) {
+	if ((f = fopen(nvramtool_op.param, "wb")) == NULL) {
 		fprintf(stderr, "%s: Can not open file %s for writing: %s\n",
 			prog_name, nvramtool_op.param, strerror(errno));
 		exit(1);
@@ -434,7 +434,7 @@ static void op_read_cmos_dump(void)
 	size_t nr_bytes;
 	FILE *f;
 
-	if ((f = fopen(nvramtool_op.param, "r")) == NULL) {
+	if ((f = fopen(nvramtool_op.param, "rb")) == NULL) {
 		fprintf(stderr, "%s: Can not open file %s for reading: %s\n",
 			prog_name, nvramtool_op.param, strerror(errno));
 		exit(1);




More information about the coreboot mailing list