summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: abf9fa5)
raw | patch | inline | side by side (parent: abf9fa5)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 10 Jun 2008 07:18:02 +0000 (07:18 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 10 Jun 2008 07:18:02 +0000 (07:18 +0000) |
src/rrd_create.c | patch | blob | history | |
src/rrd_open.c | patch | blob | history |
diff --git a/src/rrd_create.c b/src/rrd_create.c
index bb8d45d67364c7ba593ee22efe0d022a84c3e5b9..028123ef46f4a65ce2704a755b8fd0d5e7dbf1fa 100644 (file)
--- a/src/rrd_create.c
+++ b/src/rrd_create.c
int unkn_cnt;
rrd_file_t *rrd_file_dn;
rrd_t rrd_dn;
+ unsigned flags = O_WRONLY | O_CREAT | O_TRUNC;
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+ flags |= O_BINARY;
+#endif
- if ((rrd_file = open(file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
+ if ((rrd_file = open(file_name, flags, 0666)) < 0) {
rrd_set_error("creating '%s': %s", file_name, rrd_strerror(errno));
free(rrd->stat_head);
free(rrd->live_head);
diff --git a/src/rrd_open.c b/src/rrd_open.c
index 4caebd394cf156970f622bddb4e12d68513cafba..67687fad3e3faf413f9177a473c323d4e8eddc5d 100644 (file)
--- a/src/rrd_open.c
+++ b/src/rrd_open.c
#endif
}
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+ flags |= O_BINARY;
+#endif
+
if ((rrd_file->fd = open(file_name, flags, mode)) < 0) {
rrd_set_error("opening '%s': %s", file_name, rrd_strerror(errno));
goto out_free;