diff options
author | Ron Yorston <rmy@pobox.com> | 2015-01-05 21:18:10 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2015-01-05 21:18:10 +0000 |
commit | f9bba0a50fafc7868630767a55cde9f5a16b8d76 (patch) | |
tree | 6749e1f5908daaa726dc195e3a04b7a6ac404690 /libbb | |
parent | 067f2e7eaf36deac1175eaf24eeb118adcd37179 (diff) | |
download | busybox-w32-f9bba0a50fafc7868630767a55cde9f5a16b8d76.tar.gz busybox-w32-f9bba0a50fafc7868630767a55cde9f5a16b8d76.tar.bz2 busybox-w32-f9bba0a50fafc7868630767a55cde9f5a16b8d76.zip |
Changes to allow building with MinGW-w64
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/appletlib.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index b74b6e724..dba66cc93 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -828,6 +828,18 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
828 | } | 828 | } |
829 | #endif | 829 | #endif |
830 | 830 | ||
831 | #if defined(__MINGW64_VERSION_MAJOR) | ||
832 | if ( stdin ) { | ||
833 | _setmode(fileno(stdin), _O_BINARY); | ||
834 | } | ||
835 | if ( stdout ) { | ||
836 | _setmode(fileno(stdout), _O_BINARY); | ||
837 | } | ||
838 | if ( stderr ) { | ||
839 | _setmode(fileno(stderr), _O_BINARY); | ||
840 | } | ||
841 | #endif | ||
842 | |||
831 | #if defined(SINGLE_APPLET_MAIN) | 843 | #if defined(SINGLE_APPLET_MAIN) |
832 | /* Only one applet is selected in .config */ | 844 | /* Only one applet is selected in .config */ |
833 | if (argv[1] && strncmp(argv[0], "busybox", 7) == 0) { | 845 | if (argv[1] && strncmp(argv[0], "busybox", 7) == 0) { |