From: Johannes Sixt Date: Mon, 21 Sep 2009 07:34:58 +0000 (+0200) Subject: test-genrandom: ensure stdout is set to _O_BINARY on Windows X-Git-Tag: v1.6.5-rc2~8 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a16753dc2e6f885fd30e570610c3e8cf355ecf04;p=git.git test-genrandom: ensure stdout is set to _O_BINARY on Windows 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 Signed-off-by: Junio C Hamano --- diff --git a/test-genrandom.c b/test-genrandom.c index 8ad276d06..b3c28d9a1 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 -#include +#include "git-compat-util.h" int main(int argc, char *argv[]) {