diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2011-07-16 07:24:48 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2011-07-16 07:24:48 +0000 |
commit | 65fbb19b482294bc3105256fb04cc20202b66b3f (patch) | |
tree | c75c534b64e6a426a5591674669168bc2c06b808 | |
parent | e8ec59329aee81ff03cdae0ca8543d39d29f4a4d (diff) | |
download | eet-65fbb19b482294bc3105256fb04cc20202b66b3f.tar.gz |
Eet : eet_flush2 : add O_BINARY to open()
On Windows, open() in text mode followed by fdopen() in
binary mode does not create a stream in binary mode.
So add O_BINARY to open().
SVN revision: 61418
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/lib/eet_lib.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -516,3 +516,9 @@ eet_node_children_get, eet_node_next_get, eet_node_parent_get, eet_node_type_get, eet_node_value_get, eet_node_name_get * Fix segmentation faults in several eet_node functions + +2011-07-16 Vincent Torri + + * On Windows, open() in text mode followed by fdopen() in + binary mode does not create a stream in binary mode. + So add O_BINARY to open(). diff --git a/src/lib/eet_lib.c b/src/lib/eet_lib.c index 631dcd1..7978348 100644 --- a/src/lib/eet_lib.c +++ b/src/lib/eet_lib.c @@ -475,7 +475,7 @@ eet_flush2(Eet_File *ef) /* opening for write - delete old copy of file right away */ unlink(ef->path); - fd = open(ef->path, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR); + fd = open(ef->path, O_CREAT | O_TRUNC | O_RDWR | O_BINARY, S_IRUSR | S_IWUSR); fp = fdopen(fd, "wb"); if (!fp) return EET_ERROR_NOT_WRITABLE; |