diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-09 11:34:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-09 11:34:22 -0700 |
commit | ba655d15b58ab2a00032b74e5b2617a0b658a01f (patch) | |
tree | d5085d283250abde9bbb8493e16c4d83e4f69090 /compat/mingw.c | |
parent | Merge branch 'jk/pretty-G-format-fixes' (diff) | |
parent | mingw: avoid const warning (diff) | |
download | tgif-ba655d15b58ab2a00032b74e5b2617a0b658a01f.tar.xz |
Merge branch 'sk/mingw-main'
* sk/mingw-main:
mingw: avoid const warning
Win32: move main macro to a function
Diffstat (limited to 'compat/mingw.c')
-rw-r--r-- | compat/mingw.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index a0e13bc862..c03bafa9c4 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1847,3 +1847,18 @@ int mingw_offset_1st_component(const char *path) return offset + is_dir_sep(path[offset]); } + +void mingw_startup() +{ + /* copy executable name to argv[0] */ + __argv[0] = xstrdup(_pgmptr); + + /* initialize critical section for waitpid pinfo_t list */ + InitializeCriticalSection(&pinfo_cs); + + /* set up default file mode and file modes for stdin/out/err */ + _fmode = _O_BINARY; + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); + _setmode(_fileno(stderr), _O_BINARY); +} |