forked from enlightenment/efl
eina_file: make sure we use a stringshare when virtualized.
As the filename is now a stringshare, also make sure virtual files use stringshares for the filename! Also when unmapping we still need to test whether it is copied or not as unmap will break on less tolerant architectures. @fix T6449
This commit is contained in:
parent
5b113aaa38
commit
a538f47854
|
@ -300,7 +300,7 @@ eina_file_real_close(Eina_File *file)
|
|||
|
||||
if (file->fd != -1)
|
||||
{
|
||||
if (file->global_map != MAP_FAILED)
|
||||
if (!file->copied && file->global_map != MAP_FAILED)
|
||||
munmap(file->global_map, file->length);
|
||||
close(file->fd);
|
||||
}
|
||||
|
|
|
@ -422,9 +422,9 @@ eina_file_virtualize(const char *virtual_name, const void *data, unsigned long l
|
|||
EINA_MAGIC_SET(file, EINA_FILE_MAGIC);
|
||||
file->filename = (char *)(file + 1);
|
||||
if (virtual_name)
|
||||
strcpy((char *)file->filename, virtual_name);
|
||||
file->filename = eina_stringshare_add(virtual_name);
|
||||
else
|
||||
sprintf((char *)file->filename, tmpname, ti);
|
||||
file->filename = eina_stringshare_printf(tmpname, ti);
|
||||
|
||||
eina_lock_recursive_new(&file->lock);
|
||||
file->mtime = ti / 1000;
|
||||
|
|
Loading…
Reference in New Issue