Generate output with Unix line endings even from Mingw64 utils

This affects cygcheck and strace.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-02-24 20:55:14 +01:00
parent fa9d3148bf
commit f5ecacfc6c
2 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include <string.h> #include <string.h>
#include <sys/time.h> #include <sys/time.h>
#include <ctype.h> #include <ctype.h>
#include <fcntl.h>
#include <io.h> #include <io.h>
#include <windows.h> #include <windows.h>
#include <wininet.h> #include <wininet.h>
@ -2251,6 +2252,9 @@ main (int argc, char **argv)
bool ok = true; bool ok = true;
load_cygwin (argc, argv); load_cygwin (argc, argv);
_setmode (1, _O_BINARY);
_setmode (2, _O_BINARY);
/* Need POSIX sorting while parsing args, but don't forget the /* Need POSIX sorting while parsing args, but don't forget the
user's original environment. */ user's original environment. */
char *posixly = getenv ("POSIXLY_CORRECT"); char *posixly = getenv ("POSIXLY_CORRECT");

View File

@ -13,6 +13,7 @@ details. */
#define cygwin_internal cygwin_internal_dontuse #define cygwin_internal cygwin_internal_dontuse
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <io.h>
#include <getopt.h> #include <getopt.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
@ -1054,6 +1055,9 @@ main2 (int argc, char **argv)
argc++; argc++;
} }
_setmode (1, _O_BINARY);
_setmode (2, _O_BINARY);
if (!(pgm = strrchr (*argv, '\\')) && !(pgm = strrchr (*argv, '/'))) if (!(pgm = strrchr (*argv, '\\')) && !(pgm = strrchr (*argv, '/')))
pgm = *argv; pgm = *argv;
else else