summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-12-03 11:42:08 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-12-05 21:06:04 +0100
commit0497b9685c782c24fba84a1d5391edaa8d5ce10a (patch)
tree7a9547ea7ab407cfa555598646302bbc0b21b8c4 /src/tests/eio
parent4f242fb48a5cf18b6e5ea6598681486abf791771 (diff)
efl: add binary mode to open() calls
This allows better compatibility with Windows Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_test_file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tests/eio/eio_test_file.c b/src/tests/eio/eio_test_file.c
index f0e231cd99..c17246ec26 100644
--- a/src/tests/eio/eio_test_file.c
+++ b/src/tests/eio/eio_test_file.c
@@ -14,6 +14,10 @@
14 14
15#include "eio_suite.h" 15#include "eio_suite.h"
16 16
17#ifndef O_BINARY
18# define O_BINARY 0
19#endif
20
17static unsigned int default_rights = 0755; 21static unsigned int default_rights = 0755;
18static int test_count = 0; 22static int test_count = 0;
19static const char *good_dirs[] = 23static const char *good_dirs[] =
@@ -154,7 +158,7 @@ create_test_dirs(Eina_Tmpstr *test_dirname)
154 for (i = 0; i != count; ++i) 158 for (i = 0; i != count; ++i)
155 { 159 {
156 Eina_Tmpstr *filename = get_full_path(test_dirname, files[i]); 160 Eina_Tmpstr *filename = get_full_path(test_dirname, files[i]);
157 fd = open(filename, O_RDWR|O_CREAT, default_rights); 161 fd = open(filename, O_RDWR | O_BINARY | O_CREAT, default_rights);
158 fail_if(fd < 0); 162 fail_if(fd < 0);
159 fail_if(close(fd) != 0); 163 fail_if(close(fd) != 0);
160 eina_tmpstr_del(filename); 164 eina_tmpstr_del(filename);
@@ -163,7 +167,7 @@ create_test_dirs(Eina_Tmpstr *test_dirname)
163 for (i = 0; i != count; ++i) 167 for (i = 0; i != count; ++i)
164 { 168 {
165 Eina_Tmpstr *filename = get_full_path(nested_dirname, files[i]); 169 Eina_Tmpstr *filename = get_full_path(nested_dirname, files[i]);
166 fd = open(filename, O_RDWR|O_CREAT, default_rights); 170 fd = open(filename, O_RDWR | O_BINARY | O_CREAT, default_rights);
167 fail_if(fd < 0); 171 fail_if(fd < 0);
168 fail_if(close(fd) != 0); 172 fail_if(close(fd) != 0);
169 eina_tmpstr_del(filename); 173 eina_tmpstr_del(filename);