summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_file.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-08-22 21:13:38 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-08-27 17:31:12 +0900
commitdeacfdce24871b744618ac598c2a54774291e620 (patch)
treec9442b96fbf472245050c97c1c012cd4f62ee390 /src/lib/eina/eina_file.c
parent1f82fbe14d2ac5a2437e7905065974033920d139 (diff)
eina: Fix invalid check on Eina_File::global_map
global_map is set to MAP_FAILED in case of error after mmap. So, it is initialized to MAP_FAILED and considered valid otherwise. So, we don't want to set the map to NULL or even check again NULL.
Diffstat (limited to 'src/lib/eina/eina_file.c')
-rw-r--r--src/lib/eina/eina_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index ae68287..dd2d164 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -509,7 +509,7 @@ eina_file_mmap_faulty(void *addr, long page_size)
509 509
510 eina_lock_take(&f->lock); 510 eina_lock_take(&f->lock);
511 511
512 if (f->global_map) 512 if (f->global_map != MAP_FAILED)
513 { 513 {
514 if ((unsigned char *) addr < (((unsigned char *)f->global_map) + f->length) && 514 if ((unsigned char *) addr < (((unsigned char *)f->global_map) + f->length) &&
515 (((unsigned char *) addr) + page_size) >= (unsigned char *) f->global_map) 515 (((unsigned char *) addr) + page_size) >= (unsigned char *) f->global_map)