From: Tobias Oetiker Date: Mon, 14 Nov 2011 21:30:31 +0000 (+0000) Subject: allow rrdtool for windows to properly support binary mode stdout/stdin -- Larry Adams X-Git-Tag: v1.5.0-rc1~281 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1b874ca8430a69fb2642bea6ebf82f5a31e4bd7;p=thirdparty%2Frrdtool-1.x.git allow rrdtool for windows to properly support binary mode stdout/stdin -- Larry Adams git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2207 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_tool.c b/src/rrd_tool.c index bb1bc3ed..0748d92c 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -8,6 +8,8 @@ #include "../win32/config.h" #include #include +#include +#include #else #ifdef HAVE_CONFIG_H #include "../rrd_config.h" @@ -414,6 +416,12 @@ int main( according to localeconv(3) */ setlocale(LC_ALL, ""); +#ifdef WIN32 && !defined(__CYGWIN__) + setmode(fileno(stdout), O_BINARY); + setmode(fileno(stdin), O_BINARY); +#endif + + #if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); textdomain(GETTEXT_PACKAGE);