All of lore.kernel.org
 help / color / mirror / Atom feed
* [cbootimage PATCH] cbootimage: Add 'b' (binary) flag when using fopen to open a binary file.
@ 2014-12-14 16:59 Scott Duplichan
  2014-12-15 17:27 ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Duplichan @ 2014-12-14 16:59 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA

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;
-- 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-15 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-14 16:59 [cbootimage PATCH] cbootimage: Add 'b' (binary) flag when using fopen to open a binary file Scott Duplichan
2014-12-15 17:27 ` 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

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.