summaryrefslogtreecommitdiff
path: root/src/lib
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/lib
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/lib')
-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
12 files changed, 17 insertions, 17 deletions
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 }