All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Li Frank <lznuaa@gmail.com>, msysGit <msysgit@googlegroups.com>
Subject: [PATCH] test-genrandom: ensure stdout is set to _O_BINARY on Windows
Date: Mon, 21 Sep 2009 09:34:58 +0200	[thread overview]
Message-ID: <4AB72CA2.1020808@viscovery.net> (raw)

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

             reply	other threads:[~2009-09-21  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21  7:34 Johannes Sixt [this message]
2009-09-21  7:36 ` [PATCH] test-genrandom: ensure stdout is set to _O_BINARY on Windows Junio C Hamano

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=4AB72CA2.1020808@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lznuaa@gmail.com \
    --cc=mstormo@gmail.com \
    --cc=msysgit@googlegroups.com \
    /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.