summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-12-03 09:32:39 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-12-05 21:04:36 +0100
commit3b44645363dcdd561edd9610a64f3d2c382753a9 (patch)
tree64f6c4a580e563e79ca3f1867ae510025052fd64 /src
parentd2a7882b732b4cc3a8e7b11ec1c4336bdc2029bb (diff)
efl: add binary mode to f(re)open() calls
This allows better compatibility with Windows Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/benchmarks/eina/evas_stringshare.c2
-rw-r--r--src/bin/edje/edje_codegen.c4
-rw-r--r--src/bin/edje/epp/cpplib.c2
-rw-r--r--src/bin/edje/epp/cpplib.h2
-rw-r--r--src/bin/edje/epp/cppmain.c2
-rw-r--r--src/bin/efl/efl_debugd.c2
-rw-r--r--src/examples/eina/eina_model_03.c2
-rw-r--r--src/lib/ecore/ecore.c2
-rw-r--r--src/lib/ecore_con/ecore_con_ssl.c4
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_vsync.c4
-rw-r--r--src/lib/eet/Eet.h4
-rw-r--r--src/lib/eet/eet_cipher.c4
-rw-r--r--src/lib/efreet/efreet_menu.c2
-rw-r--r--src/lib/efreet/efreet_mime.c2
-rw-r--r--src/lib/efreet/efreet_trash.c2
-rw-r--r--src/lib/eina/eina_benchmark.c4
-rw-r--r--src/lib/elua/elua.c2
-rw-r--r--src/lib/elua/io.c2
-rw-r--r--src/lib/evas/canvas/evas_render.c2
-rw-r--r--src/modules/evas/engines/fb/evas_fb_main.c2
-rw-r--r--src/modules/evas/image_savers/tgv/evas_image_save_tgv.c4
-rw-r--r--src/modules/evas/model_savers/obj/evas_model_save_obj.c4
-rw-r--r--src/modules/evas/model_savers/ply/evas_model_save_ply.c2
-rw-r--r--src/static_libs/dns/dns.c6
-rw-r--r--src/static_libs/http-parser/contrib/parsertrace.c2
-rw-r--r--src/tests/ecore/ecore_test_ecore_file.c4
-rw-r--r--src/tests/eet/eet_suite.c2
-rw-r--r--src/tests/eio/eio_test_monitor.c4
-rw-r--r--src/tests/elua/elua_lib.c2
-rw-r--r--src/utils/ecore/makekeys.c2
30 files changed, 42 insertions, 42 deletions
diff --git a/src/benchmarks/eina/evas_stringshare.c b/src/benchmarks/eina/evas_stringshare.c
index 6e8797ca01..ce0e6ebebe 100644
--- a/src/benchmarks/eina/evas_stringshare.c
+++ b/src/benchmarks/eina/evas_stringshare.c
@@ -196,7 +196,7 @@ evas_stringshare_add(const char *str)
196// { 196// {
197// char bf[256]; 197// char bf[256];
198// snprintf(bf, sizeof(bf), "strlog-%i", getpid()); 198// snprintf(bf, sizeof(bf), "strlog-%i", getpid());
199// f = fopen(bf, "w"); 199// f = fopen(bf, "wb");
200// } 200// }
201 hash_num = _evas_stringshare_hash_gen(str, &slen); 201 hash_num = _evas_stringshare_hash_gen(str, &slen);
202 for (el = share.buckets[hash_num]; el; pel = el, el = el->next) 202 for (el = share.buckets[hash_num]; el; pel = el, el = el->next)
diff --git a/src/bin/edje/edje_codegen.c b/src/bin/edje/edje_codegen.c
index f2ddc7f08b..0b2412fa37 100644
--- a/src/bin/edje/edje_codegen.c
+++ b/src/bin/edje/edje_codegen.c
@@ -387,11 +387,11 @@ _standardizes_header(const char *filename)
387static Eina_Bool 387static Eina_Bool
388_open_file_descriptors(const char *source, const char *header) 388_open_file_descriptors(const char *source, const char *header)
389{ 389{
390 header_fd = fopen(header, "w"); 390 header_fd = fopen(header, "wb");
391 if (!header_fd) 391 if (!header_fd)
392 return EINA_FALSE; 392 return EINA_FALSE;
393 393
394 source_fd = fopen(source, "w"); 394 source_fd = fopen(source, "wb");
395 if (!source_fd) 395 if (!source_fd)
396 goto err; 396 goto err;
397 397
diff --git a/src/bin/edje/epp/cpplib.c b/src/bin/edje/epp/cpplib.c
index b8e0ff2d64..0d2b5035c9 100644
--- a/src/bin/edje/epp/cpplib.c
+++ b/src/bin/edje/epp/cpplib.c
@@ -7492,7 +7492,7 @@ using_file(const char *filename, const char type)
7492 FILE *f = NULL; 7492 FILE *f = NULL;
7493 7493
7494 if (!options.watchfile) return; 7494 if (!options.watchfile) return;
7495 f = fopen(options.watchfile, "a"); 7495 f = fopen(options.watchfile, "ab");
7496 if (!f) return; 7496 if (!f) return;
7497 if (annotate) 7497 if (annotate)
7498 { 7498 {
diff --git a/src/bin/edje/epp/cpplib.h b/src/bin/edje/epp/cpplib.h
index c040ebddcc..18b66700e8 100644
--- a/src/bin/edje/epp/cpplib.h
+++ b/src/bin/edje/epp/cpplib.h
@@ -345,7 +345,7 @@ struct cpp_options {
345 345
346 char print_deps_missing_files; 346 char print_deps_missing_files;
347 347
348 /* If true, fopen (deps_file, "a") else fopen (deps_file, "w"). */ 348 /* If true, fopen (deps_file, "ab") else fopen (deps_file, "wb"). */
349 char print_deps_append; 349 char print_deps_append;
350 350
351 /* Nonzero means print names of header files (-H). */ 351 /* Nonzero means print names of header files (-H). */
diff --git a/src/bin/edje/epp/cppmain.c b/src/bin/edje/epp/cppmain.c
index 2e8059bf09..be04bac777 100644
--- a/src/bin/edje/epp/cppmain.c
+++ b/src/bin/edje/epp/cppmain.c
@@ -74,7 +74,7 @@ main(int argc, char **argv)
74 74
75 if (!opts->out_fname || !strcmp(opts->out_fname, "")) 75 if (!opts->out_fname || !strcmp(opts->out_fname, ""))
76 opts->out_fname = "stdout"; 76 opts->out_fname = "stdout";
77 else if (!freopen(opts->out_fname, "w", stdout)) 77 else if (!freopen(opts->out_fname, "wb", stdout))
78 cpp_pfatal_with_name(&parse_in, opts->out_fname); 78 cpp_pfatal_with_name(&parse_in, opts->out_fname);
79 79
80 for (i = 0;; i++) 80 for (i = 0;; i++)
diff --git a/src/bin/efl/efl_debugd.c b/src/bin/efl/efl_debugd.c
index a1025fbb4e..a07fe3fcee 100644
--- a/src/bin/efl/efl_debugd.c
+++ b/src/bin/efl/efl_debugd.c
@@ -129,7 +129,7 @@ _do(Client *c, char *op, unsigned char *d, int size)
129 c2->evlog_fetch_timer = ecore_timer_add(0.2, _cb_evlog, c2); 129 c2->evlog_fetch_timer = ecore_timer_add(0.2, _cb_evlog, c2);
130 snprintf(buf, sizeof(buf), "%s/efl_debug_evlog-%ld.log", 130 snprintf(buf, sizeof(buf), "%s/efl_debug_evlog-%ld.log",
131 getenv("HOME"), (long)c2->pid); 131 getenv("HOME"), (long)c2->pid);
132 c2->evlog_file = fopen(buf, "w"); 132 c2->evlog_file = fopen(buf, "wb");
133 } 133 }
134 } 134 }
135 } 135 }
diff --git a/src/examples/eina/eina_model_03.c b/src/examples/eina/eina_model_03.c
index a5e2562f15..61498da47c 100644
--- a/src/examples/eina/eina_model_03.c
+++ b/src/examples/eina/eina_model_03.c
@@ -106,7 +106,7 @@ _address_book_load(Eina_Model *model)
106 106
107 EINA_SAFETY_ON_NULL_RETURN_VAL(filename, EINA_FALSE); 107 EINA_SAFETY_ON_NULL_RETURN_VAL(filename, EINA_FALSE);
108 108
109 f = fopen(filename, "r"); 109 f = fopen(filename, "rb");
110 110
111 // Now that we have used filename, we must free its memory holder: 111 // Now that we have used filename, we must free its memory holder:
112 eina_value_flush(&val); 112 eina_value_flush(&val);
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index f1212581a3..d9fc9d9845 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -271,7 +271,7 @@ ecore_init(void)
271 char tmp[1024]; 271 char tmp[1024];
272 272
273 snprintf(tmp, sizeof(tmp), "ecore_mem_stat.%i", getpid()); 273 snprintf(tmp, sizeof(tmp), "ecore_mem_stat.%i", getpid());
274 _ecore_memory_statistic_file = fopen(tmp, "w"); 274 _ecore_memory_statistic_file = fopen(tmp, "wb");
275#endif 275#endif
276 _ecore_memory_pid = getpid(); 276 _ecore_memory_pid = getpid();
277 ecore_animator_add(_ecore_memory_statistic, NULL); 277 ecore_animator_add(_ecore_memory_statistic, NULL);
diff --git a/src/lib/ecore_con/ecore_con_ssl.c b/src/lib/ecore_con/ecore_con_ssl.c
index f16dd69d76..3c24afba43 100644
--- a/src/lib/ecore_con/ecore_con_ssl.c
+++ b/src/lib/ecore_con/ecore_con_ssl.c
@@ -1589,7 +1589,7 @@ _ecore_con_ssl_server_privkey_add_openssl(Ecore_Con_Server *obj,
1589 FILE *fp = NULL; 1589 FILE *fp = NULL;
1590 EVP_PKEY *privkey = NULL; 1590 EVP_PKEY *privkey = NULL;
1591 1591
1592 if (!(fp = fopen(key_file, "r"))) 1592 if (!(fp = fopen(key_file, "rb")))
1593 goto error; 1593 goto error;
1594 1594
1595 SSL_ERROR_CHECK_GOTO_ERROR(!(privkey = PEM_read_PrivateKey(fp, NULL, NULL, NULL))); 1595 SSL_ERROR_CHECK_GOTO_ERROR(!(privkey = PEM_read_PrivateKey(fp, NULL, NULL, NULL)));
@@ -1616,7 +1616,7 @@ _ecore_con_ssl_server_cert_add_openssl(Ecore_Con_Server *obj,
1616 FILE *fp = NULL; 1616 FILE *fp = NULL;
1617 X509 *cert = NULL; 1617 X509 *cert = NULL;
1618 1618
1619 if (!(fp = fopen(cert_file, "r"))) 1619 if (!(fp = fopen(cert_file, "rb")))
1620 goto error; 1620 goto error;
1621 1621
1622 SSL_ERROR_CHECK_GOTO_ERROR(!(cert = PEM_read_X509(fp, NULL, NULL, NULL))); 1622 SSL_ERROR_CHECK_GOTO_ERROR(!(cert = PEM_read_X509(fp, NULL, NULL, NULL)));
diff --git a/src/lib/ecore_x/xlib/ecore_x_vsync.c b/src/lib/ecore_x/xlib/ecore_x_vsync.c
index ea35b5a4ff..bdf832c97b 100644
--- a/src/lib/ecore_x/xlib/ecore_x_vsync.c
+++ b/src/lib/ecore_x/xlib/ecore_x_vsync.c
@@ -443,7 +443,7 @@ _drm_init(int *flags)
443 if (stat("/sys/module/vboxvideo", &st) == 0) 443 if (stat("/sys/module/vboxvideo", &st) == 0)
444 { 444 {
445/* 445/*
446 FILE *fp = fopen("/sys/module/vboxvideo/version", "r"); 446 FILE *fp = fopen("/sys/module/vboxvideo/version", "rb");
447 if (fp) 447 if (fp)
448 { 448 {
449 if (fgets(buf, sizeof(buf), fp)) 449 if (fgets(buf, sizeof(buf), fp))
@@ -462,7 +462,7 @@ _drm_init(int *flags)
462 // only do this on new kernels = let's say 3.14 and up. 3.16 definitely 462 // only do this on new kernels = let's say 3.14 and up. 3.16 definitely
463 // works 463 // works
464 { 464 {
465 FILE *fp = fopen("/proc/sys/kernel/osrelease", "r"); 465 FILE *fp = fopen("/proc/sys/kernel/osrelease", "rb");
466 if (fp) 466 if (fp)
467 { 467 {
468 if (fgets(buf, sizeof(buf), fp)) 468 if (fgets(buf, sizeof(buf), fp))
diff --git a/src/lib/eet/Eet.h b/src/lib/eet/Eet.h
index 62074fd40d..c861165c09 100644
--- a/src/lib/eet/Eet.h
+++ b/src/lib/eet/Eet.h
@@ -3224,7 +3224,7 @@ typedef void (*Eet_Dump_Callback)(void *data, const char *str);
3224 * int len; 3224 * int len;
3225 * void *data; 3225 * void *data;
3226 * 3226 *
3227 * f = fopen(file, "r"); 3227 * f = fopen(file, "rb");
3228 * fseek(f, 0, SEEK_END); 3228 * fseek(f, 0, SEEK_END);
3229 * len = ftell(f); 3229 * len = ftell(f);
3230 * rewind(f); 3230 * rewind(f);
@@ -4030,7 +4030,7 @@ eet_data_xattr_cipher_set(const char *filename,
4030 * int len; 4030 * int len;
4031 * void *data; 4031 * void *data;
4032 * 4032 *
4033 * f = fopen(file, "r"); 4033 * f = fopen(file, "rb");
4034 * fseek(f, 0, SEEK_END); 4034 * fseek(f, 0, SEEK_END);
4035 * len = ftell(f); 4035 * len = ftell(f);
4036 * rewind(f); 4036 * rewind(f);
diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c
index aa57e5caab..a34fdfff4b 100644
--- a/src/lib/eet/eet_cipher.c
+++ b/src/lib/eet/eet_cipher.c
@@ -192,7 +192,7 @@ on_error:
192 if (!emile_cipher_init()) return NULL; 192 if (!emile_cipher_init()) return NULL;
193 193
194 /* Load the X509 certificate in memory. */ 194 /* Load the X509 certificate in memory. */
195 fp = fopen(certificate_file, "r"); 195 fp = fopen(certificate_file, "rb");
196 if (!fp) 196 if (!fp)
197 return NULL; 197 return NULL;
198 198
@@ -207,7 +207,7 @@ on_error:
207 goto on_error; 207 goto on_error;
208 208
209 /* Load the private key in memory. */ 209 /* Load the private key in memory. */
210 fp = fopen(private_key_file, "r"); 210 fp = fopen(private_key_file, "rb");
211 if (!fp) 211 if (!fp)
212 goto on_error; 212 goto on_error;
213 213
diff --git a/src/lib/efreet/efreet_menu.c b/src/lib/efreet/efreet_menu.c
index ada789b7e0..b774460c98 100644
--- a/src/lib/efreet/efreet_menu.c
+++ b/src/lib/efreet/efreet_menu.c
@@ -687,7 +687,7 @@ efreet_menu_save(Efreet_Menu *menu, const char *path)
687 EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0); 687 EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0);
688 EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0); 688 EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
689 689
690 f = fopen(path, "w"); 690 f = fopen(path, "wb");
691 if (!f) return 0; 691 if (!f) return 0;
692 fprintf(f, "<?xml version=\"1.0\"?>\n"); 692 fprintf(f, "<?xml version=\"1.0\"?>\n");
693 fprintf(f, "<!DOCTYPE Menu PUBLIC \"-//freedesktop//DTD Menu 1.0//EN\" " 693 fprintf(f, "<!DOCTYPE Menu PUBLIC \"-//freedesktop//DTD Menu 1.0//EN\" "
diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c
index 23d86cfd3f..adfa79053a 100644
--- a/src/lib/efreet/efreet_mime.c
+++ b/src/lib/efreet/efreet_mime.c
@@ -752,7 +752,7 @@ efreet_mime_fallback_check(const char *file)
752 if (ecore_file_can_exec(file)) 752 if (ecore_file_can_exec(file))
753 return _mime_application_x_executable; 753 return _mime_application_x_executable;
754 754
755 if (!(f = fopen(file, "r"))) return NULL; 755 if (!(f = fopen(file, "rb"))) return NULL;
756 756
757 i = fread(buf, 1, sizeof(buf), f); 757 i = fread(buf, 1, sizeof(buf), f);
758 fclose(f); 758 fclose(f);
diff --git a/src/lib/efreet/efreet_trash.c b/src/lib/efreet/efreet_trash.c
index 50a273b811..5d9fd25979 100644
--- a/src/lib/efreet/efreet_trash.c
+++ b/src/lib/efreet/efreet_trash.c
@@ -215,7 +215,7 @@ efreet_trash_delete_uri(Efreet_Uri *uri, int force_delete)
215 /* create info file */ 215 /* create info file */
216 snprintf(dest, sizeof(dest), "%s/info/%s.trashinfo", trash_dir, fname); 216 snprintf(dest, sizeof(dest), "%s/info/%s.trashinfo", trash_dir, fname);
217 217
218 if ((f = fopen(dest, "w"))) 218 if ((f = fopen(dest, "wb")))
219 { 219 {
220 fputs("[Trash Info]\n", f); 220 fputs("[Trash Info]\n", f);
221 221
diff --git a/src/lib/eina/eina_benchmark.c b/src/lib/eina/eina_benchmark.c
index d018a0ae0d..0159ddc565 100644
--- a/src/lib/eina/eina_benchmark.c
+++ b/src/lib/eina/eina_benchmark.c
@@ -239,7 +239,7 @@ eina_benchmark_run(Eina_Benchmark *bench)
239 bench->name, 239 bench->name,
240 bench->run); 240 bench->run);
241 241
242 main_script = fopen(buffer, "w"); 242 main_script = fopen(buffer, "wb");
243 if (!main_script) 243 if (!main_script)
244 return NULL; 244 return NULL;
245 245
@@ -293,7 +293,7 @@ eina_benchmark_run(Eina_Benchmark *bench)
293 bench->run, 293 bench->run,
294 run->name); 294 run->name);
295 295
296 current_data = fopen(buffer, "w"); 296 current_data = fopen(buffer, "wb");
297 if (!current_data) 297 if (!current_data)
298 continue; 298 continue;
299 299
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index 602e5d1825..47bcd3fb76 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -617,7 +617,7 @@ elua_util_script_run(Elua_State *es, int argc, char **argv, int n, int *quit)
617 if (fname) 617 if (fname)
618 { 618 {
619 /* check if there is a file of that name */ 619 /* check if there is a file of that name */
620 FILE *f = fopen(fname, "r"); 620 FILE *f = fopen(fname, "rb");
621 if (f) 621 if (f)
622 { 622 {
623 fclose(f); 623 fclose(f);
diff --git a/src/lib/elua/io.c b/src/lib/elua/io.c
index d5b8a0c7d1..6835e9936f 100644
--- a/src/lib/elua/io.c
+++ b/src/lib/elua/io.c
@@ -10,7 +10,7 @@ get_cmdline_from_argv(const char *fname, const char **argv)
10 char pbuf[PATH_MAX]; 10 char pbuf[PATH_MAX];
11 const char *arg = NULL; 11 const char *arg = NULL;
12 12
13 FILE *testf = fopen(fname, "r"); 13 FILE *testf = fopen(fname, "rb");
14 if (!testf) 14 if (!testf)
15 return NULL; 15 return NULL;
16 16
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 63749e8284..1645ebcf4c 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -29,7 +29,7 @@ rend_dbg(const char *txt)
29#ifdef STDOUT_DBG 29#ifdef STDOUT_DBG
30 dbf = stdout; 30 dbf = stdout;
31#else 31#else
32 dbf = fopen("EVAS-RENDER-DEBUG.log", "w"); 32 dbf = fopen("EVAS-RENDER-DEBUG.log", "wb");
33#endif 33#endif
34 if (!dbf) return; 34 if (!dbf) return;
35 } 35 }
diff --git a/src/modules/evas/engines/fb/evas_fb_main.c b/src/modules/evas/engines/fb/evas_fb_main.c
index 3b8b23b5da..aab4147b4b 100644
--- a/src/modules/evas/engines/fb/evas_fb_main.c
+++ b/src/modules/evas/engines/fb/evas_fb_main.c
@@ -345,7 +345,7 @@ fb_list_modes(unsigned int *num_return)
345 int num; 345 int num;
346 346
347 num = 0; 347 num = 0;
348 f = fopen("/etc/fb.modes","r"); 348 f = fopen("/etc/fb.modes","rb");
349 if (!f) 349 if (!f)
350 { 350 {
351 *num_return = 0; 351 *num_return = 0;
diff --git a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c
index 44b38e0b39..aa0a82b943 100644
--- a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c
+++ b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c
@@ -111,7 +111,7 @@ _save_direct_tgv(RGBA_Image *im, const char *file, int compress)
111 // header[7]: options (unused) 111 // header[7]: options (unused)
112 header[7] = 0; 112 header[7] = 0;
113 113
114 f = fopen(file, "w"); 114 f = fopen(file, "wb");
115 if (!f) return 0; 115 if (!f) return 0;
116 116
117 // Write header 117 // Write header
@@ -300,7 +300,7 @@ evas_image_save_file_tgv(RGBA_Image *im,
300 // Note: consider extending the header instead of filling all the bits here 300 // Note: consider extending the header instead of filling all the bits here
301 header[7] = 0; 301 header[7] = 0;
302 302
303 f = fopen(file, "w"); 303 f = fopen(file, "wb");
304 if (!f) return 0; 304 if (!f) return 0;
305 305
306 // Write header 306 // Write header
diff --git a/src/modules/evas/model_savers/obj/evas_model_save_obj.c b/src/modules/evas/model_savers/obj/evas_model_save_obj.c
index 09e5c723c6..8789ce44eb 100644
--- a/src/modules/evas/model_savers/obj/evas_model_save_obj.c
+++ b/src/modules/evas/model_savers/obj/evas_model_save_obj.c
@@ -163,7 +163,7 @@ _save_mesh(Evas_Canvas3D_Mesh_Data *pd,
163 163
164 evas_model_save_data_from_mesh(pd, f, header, &data); 164 evas_model_save_data_from_mesh(pd, f, header, &data);
165 165
166 FILE * _obj_file = fopen(_obj_file_name, "w+"); 166 FILE * _obj_file = fopen(_obj_file_name, "wb+");
167 if (!_obj_file) 167 if (!_obj_file)
168 { 168 {
169 ERR("File open '%s' for save failed", _obj_file_name); 169 ERR("File open '%s' for save failed", _obj_file_name);
@@ -191,7 +191,7 @@ _save_material(Evas_Canvas3D_Mesh_Data *pd EINA_UNUSED,
191 const char *_mtl_file_name, 191 const char *_mtl_file_name,
192 Evas_Canvas3D_Material_Data *mat) 192 Evas_Canvas3D_Material_Data *mat)
193{ 193{
194 FILE * _mtl_file = fopen(_mtl_file_name, "w+"); 194 FILE * _mtl_file = fopen(_mtl_file_name, "wb+");
195 if (!_mtl_file) 195 if (!_mtl_file)
196 { 196 {
197 ERR("File open '%s' for save failed", _mtl_file_name); 197 ERR("File open '%s' for save failed", _mtl_file_name);
diff --git a/src/modules/evas/model_savers/ply/evas_model_save_ply.c b/src/modules/evas/model_savers/ply/evas_model_save_ply.c
index 8da8f741ea..805f267bc0 100644
--- a/src/modules/evas/model_savers/ply/evas_model_save_ply.c
+++ b/src/modules/evas/model_savers/ply/evas_model_save_ply.c
@@ -75,7 +75,7 @@ evas_model_save_file_ply(const Evas_Canvas3D_Mesh *mesh,
75 if (!evas_model_save_header_from_mesh(pd, f, &header)) return; 75 if (!evas_model_save_header_from_mesh(pd, f, &header)) return;
76 evas_model_save_data_from_mesh(pd, f, header, &data); 76 evas_model_save_data_from_mesh(pd, f, header, &data);
77 77
78 FILE *_ply_file = fopen(file, "w+"); 78 FILE *_ply_file = fopen(file, "wb+");
79 if (!_ply_file) 79 if (!_ply_file)
80 { 80 {
81 ERR("File open '%s' for save failed", file); 81 ERR("File open '%s' for save failed", file);
diff --git a/src/static_libs/dns/dns.c b/src/static_libs/dns/dns.c
index 0100550680..a426a53476 100644
--- a/src/static_libs/dns/dns.c
+++ b/src/static_libs/dns/dns.c
@@ -3516,7 +3516,7 @@ int dns_hosts_loadpath(struct dns_hosts *hosts, const char *path) {
3516 FILE *fp; 3516 FILE *fp;
3517 int error; 3517 int error;
3518 3518
3519 if (!(fp = fopen(path, "r"))) 3519 if (!(fp = fopen(path, "rb")))
3520 return dns_syerr(); 3520 return dns_syerr();
3521 3521
3522 error = dns_hosts_loadfile(hosts, fp); 3522 error = dns_hosts_loadfile(hosts, fp);
@@ -4073,7 +4073,7 @@ int dns_resconf_loadpath(struct dns_resolv_conf *resconf, const char *path) {
4073 FILE *fp; 4073 FILE *fp;
4074 int error; 4074 int error;
4075 4075
4076 if (!(fp = fopen(path, "r"))) 4076 if (!(fp = fopen(path, "rb")))
4077 return dns_syerr(); 4077 return dns_syerr();
4078 4078
4079 error = dns_resconf_loadfile(resconf, fp); 4079 error = dns_resconf_loadfile(resconf, fp);
@@ -4456,7 +4456,7 @@ int dns_nssconf_loadpath(struct dns_resolv_conf *resconf, const char *path) {
4456 FILE *fp; 4456 FILE *fp;
4457 int error; 4457 int error;
4458 4458
4459 if (!(fp = fopen(path, "r"))) 4459 if (!(fp = fopen(path, "rb")))
4460 return dns_syerr(); 4460 return dns_syerr();
4461 4461
4462 error = dns_nssconf_loadfile(resconf, fp); 4462 error = dns_nssconf_loadfile(resconf, fp);
diff --git a/src/static_libs/http-parser/contrib/parsertrace.c b/src/static_libs/http-parser/contrib/parsertrace.c
index c9bc71ec01..ed35f8638b 100644
--- a/src/static_libs/http-parser/contrib/parsertrace.c
+++ b/src/static_libs/http-parser/contrib/parsertrace.c
@@ -108,7 +108,7 @@ int main(int argc, char* argv[]) {
108 } 108 }
109 109
110 char* filename = argv[2]; 110 char* filename = argv[2];
111 FILE* file = fopen(filename, "r"); 111 FILE* file = fopen(filename, "rb");
112 if (file == NULL) { 112 if (file == NULL) {
113 perror("fopen"); 113 perror("fopen");
114 return EXIT_FAILURE; 114 return EXIT_FAILURE;
diff --git a/src/tests/ecore/ecore_test_ecore_file.c b/src/tests/ecore/ecore_test_ecore_file.c
index 93689ac4ec..1e2d801039 100644
--- a/src/tests/ecore/ecore_test_ecore_file.c
+++ b/src/tests/ecore/ecore_test_ecore_file.c
@@ -20,9 +20,9 @@
20void 20void
21_writeToFile(const char *filePath, char *text) 21_writeToFile(const char *filePath, char *text)
22{ 22{
23 FILE *f = fopen(filePath, "r+"); 23 FILE *f = fopen(filePath, "rb+");
24 if (f == NULL) 24 if (f == NULL)
25 f = fopen(filePath, "w"); 25 f = fopen(filePath, "wb");
26 fail_if(f == NULL); 26 fail_if(f == NULL);
27 fprintf(f, "%s\n", text); 27 fprintf(f, "%s\n", text);
28 fclose(f); 28 fclose(f);
diff --git a/src/tests/eet/eet_suite.c b/src/tests/eet/eet_suite.c
index 9db0e9ce93..673294bbb9 100644
--- a/src/tests/eet/eet_suite.c
+++ b/src/tests/eet/eet_suite.c
@@ -1734,7 +1734,7 @@ START_TEST(eet_identity_simple)
1734 1734
1735 fail_if(-1 == (fd = mkstemp(file))); 1735 fail_if(-1 == (fd = mkstemp(file)));
1736 fail_if(!!close(fd)); 1736 fail_if(!!close(fd));
1737 fail_if(!(noread = fopen("/dev/null", "w"))); 1737 fail_if(!(noread = fopen("/dev/null", "wb")));
1738 1738
1739 /* Sign an eet file. */ 1739 /* Sign an eet file. */
1740 ef = eet_open(file, EET_FILE_MODE_WRITE); 1740 ef = eet_open(file, EET_FILE_MODE_WRITE);
diff --git a/src/tests/eio/eio_test_monitor.c b/src/tests/eio/eio_test_monitor.c
index 7b93928ff3..daf2a3fd0d 100644
--- a/src/tests/eio/eio_test_monitor.c
+++ b/src/tests/eio/eio_test_monitor.c
@@ -72,7 +72,7 @@ static Eina_Bool _create_directory(void *data)
72 72
73static Eina_Bool _create_file(void *data) 73static Eina_Bool _create_file(void *data)
74{ 74{
75 FILE *fd = fopen((const char*)data, "w+"); 75 FILE *fd = fopen((const char*)data, "wb+");
76 ck_assert_ptr_ne(fd, NULL); 76 ck_assert_ptr_ne(fd, NULL);
77 fprintf(fd, "test test"); 77 fprintf(fd, "test test");
78 fclose(fd); 78 fclose(fd);
@@ -88,7 +88,7 @@ static Eina_Bool _delete_file(void *data)
88 88
89static Eina_Bool _modify_file(void *data) 89static Eina_Bool _modify_file(void *data)
90{ 90{
91 FILE *fd = fopen((const char*)data, "a"); 91 FILE *fd = fopen((const char*)data, "ab");
92 ck_assert_ptr_ne(fd, NULL); 92 ck_assert_ptr_ne(fd, NULL);
93 fprintf(fd, "appened"); 93 fprintf(fd, "appened");
94 fclose(fd); 94 fclose(fd);
diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c
index 43df108113..aecc26a022 100644
--- a/src/tests/elua/elua_lib.c
+++ b/src/tests/elua/elua_lib.c
@@ -116,7 +116,7 @@ START_TEST(elua_api)
116 fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit)); 116 fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit));
117 fail_if(quit != 1); 117 fail_if(quit != 1);
118 118
119 f = fopen(buf, "w"); 119 f = fopen(buf, "wb");
120 fail_if(!f); 120 fail_if(!f);
121 fprintf(f, "return false"); 121 fprintf(f, "return false");
122 fclose(f); 122 fclose(f);
diff --git a/src/utils/ecore/makekeys.c b/src/utils/ecore/makekeys.c
index 69383af416..87b76c6e54 100644
--- a/src/utils/ecore/makekeys.c
+++ b/src/utils/ecore/makekeys.c
@@ -66,7 +66,7 @@ main(int argc, char **argv)
66 66
67 for (l = 1; l < argc; l++) 67 for (l = 1; l < argc; l++)
68 { 68 {
69 if (!(fptr = fopen(argv[l], "r"))) 69 if (!(fptr = fopen(argv[l], "rb")))
70 { 70 {
71 fprintf(stderr, "Could not open %s\n", argv[l]); 71 fprintf(stderr, "Could not open %s\n", argv[l]);
72 continue; 72 continue;