All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Scott Duplichan" <scott-CDj6QYrFEYEdnm+yROfE0A@public.gmane.org>
To: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [cbootimage PATCH] cbootimage: Add 'b' (binary) flag when using fopen to open a binary file.
Date: Sun, 14 Dec 2014 10:59:51 -0600	[thread overview]
Message-ID: <000f01d017bf$61e0cfe0$25a26fa0$@notabs.org> (raw)

Add 'b' (binary) flag when using fopen to open a binary file.
This keeps Windows from expanding \n to \r\n and interpreting
<ctrl>z as end of file. The change is to support a Windows
hosted coreboot build environment.

Signed-off-by: Scott Duplichan <scott-CDj6QYrFEYEdnm+yROfE0A@public.gmane.org>
---
diff --git a/src/set.c b/src/set.c
index 0af6686..e8ae3dd 100644
--- a/src/set.c
+++ b/src/set.c
@@ -53,7 +53,7 @@ read_from_image(char	*filename,
 	FILE *fp;
 	struct stat stats;
 
-	fp = fopen(filename, "r");
+	fp = fopen(filename, "rb");
 	if (fp == NULL) {
 		result = 1;
 		return result;
-- 

             reply	other threads:[~2014-12-14 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-14 16:59 Scott Duplichan [this message]
2014-12-15 17:27 ` [cbootimage PATCH] cbootimage: Add 'b' (binary) flag when using fopen to open a binary file Stephen Warren
     [not found]   ` <548F1A1B.5020708-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-12-15 21:16     ` Scott Duplichan
2014-12-15 22:05       ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000f01d017bf$61e0cfe0$25a26fa0$@notabs.org' \
    --to=scott-cdj6qyrfeyednm+yrofe0a@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.