summaryrefslogtreecommitdiff
path: root/src/lib/eet/eet_lib.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-08 21:38:01 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-08 22:37:09 +0200
commit2e5a5d6656e9fca4ee756819dcd17e875225e447 (patch)
treee0b34eea8161ff29ae2ecb6d855fbb2504985757 /src/lib/eet/eet_lib.c
parentdc7910a7efaef2cdad999c2e46d92f551924cf5e (diff)
eet: call LOCK_CACHE before altering Eet_File
even if not necessary in this particular case, do as in eet_mmap() and eet_open(), lock the cache before altering Eet_File struct. fix CID 1039366 1039367 1039368 1039369
Diffstat (limited to 'src/lib/eet/eet_lib.c')
-rw-r--r--src/lib/eet/eet_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index 69d8bca670..daa6d3b897 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -1397,6 +1397,9 @@ eet_memopen_read(const void *data,
1397 if (!ef) 1397 if (!ef)
1398 return NULL; 1398 return NULL;
1399 1399
1400 /* eet_internal_read expects the cache lock to be held when it is called */
1401 LOCK_CACHE;
1402
1400 INIT_FILE(ef); 1403 INIT_FILE(ef);
1401 ef->ed = NULL; 1404 ef->ed = NULL;
1402 ef->path = NULL; 1405 ef->path = NULL;
@@ -1413,8 +1416,6 @@ eet_memopen_read(const void *data,
1413 ef->sha1_length = 0; 1416 ef->sha1_length = 0;
1414 ef->readfp_owned = EINA_FALSE; 1417 ef->readfp_owned = EINA_FALSE;
1415 1418
1416 /* eet_internal_read expects the cache lock to be held when it is called */
1417 LOCK_CACHE;
1418 ef = eet_internal_read(ef); 1419 ef = eet_internal_read(ef);
1419 UNLOCK_CACHE; 1420 UNLOCK_CACHE;
1420 return ef; 1421 return ef;