projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow rrdtool for windows to properly support binary mode stdout/stdin -- Larry Adams
[rrdtool.git]
/
src
/
rrd_tool.c
diff --git
a/src/rrd_tool.c
b/src/rrd_tool.c
index
bb1bc3e
..
0748d92
100644
(file)
--- a/
src/rrd_tool.c
+++ b/
src/rrd_tool.c
@@
-8,6
+8,8
@@
#include "../win32/config.h"
#include <stdlib.h>
#include <sys/stat.h>
#include "../win32/config.h"
#include <stdlib.h>
#include <sys/stat.h>
+#include <io.h>
+#include <fcntl.h>
#else
#ifdef HAVE_CONFIG_H
#include "../rrd_config.h"
#else
#ifdef HAVE_CONFIG_H
#include "../rrd_config.h"
@@
-414,6
+416,12
@@
int main(
according to localeconv(3) */
setlocale(LC_ALL, "");
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);
#if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL)
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
textdomain(GETTEXT_PACKAGE);