summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-21 09:18:52 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-21 09:18:52 +0900
commit414b447f54638a6c241c3a55c235945e76c6972f (patch)
tree50cbbb7fd57f3cdafce4fd5b0ba678f0d1da8195 /src
parent1a9ebc02c08577edca96d804611d254f59254eb5 (diff)
Revert "eet: do not load data when the file is open in read/write mode."
This reverts commit f8b0322704a4d74e4a5545727c18dc8385318657. this breaks efreets icon cache. i have been noticing this since yesterday across all my machines once i update just efl. i tracked it down to this commit.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eet/eet_lib.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index 63f8e4f5f7..6ff2a3cbd3 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -482,12 +482,7 @@ eet_flush2(Eet_File *ef)
482 { 482 {
483 for (efn = ef->header->directory->nodes[i]; efn; efn = efn->next) 483 for (efn = ef->header->directory->nodes[i]; efn; efn = efn->next)
484 { 484 {
485 if (efn->data) 485 if (fwrite(efn->data, efn->size, 1, fp) != 1)
486 {
487 if (fwrite(efn->data, efn->size, 1, fp) != 1)
488 goto write_error;
489 }
490 else if (fwrite(ef->data + efn->offset, efn->size, 1, fp) != 1)
491 goto write_error; 486 goto write_error;
492 } 487 }
493 } 488 }
@@ -909,8 +904,15 @@ eet_internal_read2(Eet_File *ef)
909 efn->next = ef->header->directory->nodes[hash]; 904 efn->next = ef->header->directory->nodes[hash];
910 ef->header->directory->nodes[hash] = efn; 905 ef->header->directory->nodes[hash] = efn;
911 906
912 /* There is no need to load data at this stage */ 907 /* read-only mode, so currently we have no data loaded */
913 efn->data = NULL; 908 if (ef->mode == EET_FILE_MODE_READ)
909 efn->data = NULL; /* read-write mode - read everything into ram */
910 else
911 {
912 efn->data = malloc(efn->size);
913 if (efn->data)
914 memcpy(efn->data, ef->data + efn->offset, efn->size);
915 }
914 916
915 /* compute the possible position of a signature */ 917 /* compute the possible position of a signature */
916 if (signature_base_offset < efn->offset + efn->size) 918 if (signature_base_offset < efn->offset + efn->size)