git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] test-genrandom: ensure stdout is set to _O_BINARY on Windows
@ 2009-09-21  7:34 Johannes Sixt
  2009-09-21  7:36 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Sixt @ 2009-09-21  7:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Marius Storm-Olsen, Git Mailing List, Li Frank, msysGit

From: Johannes Sixt <j6t@kdbg.org>

Commit a6ca8c62 (Set _O_BINARY as default fmode for both MinGW and MSVC)
removed the definition of _CRT_fmode from mingw.c. Before this commit,
since test-genrandom is linked against libgit.a, the MinGW process
initialization code would pick up that definition of _CRT_fmode, which was
initialized to _O_BINARY. After this commit, however, text mode is used
for std(in|out|err) because it is the default in absence of _CRT_fmode.
In order to fix that, we must use git-compat-util.h, which overrides
main() to set the mode to binary.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 Unfortunately, this change in an updated patch 04/15 of the MSVC series
 went to the Big Void. ;)

 -- Hannes

 test-genrandom.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/test-genrandom.c b/test-genrandom.c
index 8ad276d..b3c28d9 100644
--- a/test-genrandom.c
+++ b/test-genrandom.c
@@ -4,8 +4,7 @@
  * Copyright (C) 2007 by Nicolas Pitre, licensed under the GPL version 2.
  */

-#include <stdio.h>
-#include <stdlib.h>
+#include "git-compat-util.h"

 int main(int argc, char *argv[])
 {
-- 
1.6.5.rc1.1051.gdc4fd

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

end of thread, other threads:[~2009-09-21  7:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21  7:34 [PATCH] test-genrandom: ensure stdout is set to _O_BINARY on Windows Johannes Sixt
2009-09-21  7:36 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).