forked from enlightenment/efl
use memset so we never have this problem again and also put in
eina_file_win32.c SVN revision: 71345
This commit is contained in:
parent
9a3e561f69
commit
b6b502885a
|
@ -990,13 +990,14 @@ eina_file_open(const char *path, Eina_Bool shared)
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
n = malloc(sizeof (Eina_File) + strlen(filename) + 1);
|
n = malloc(sizeof(Eina_File) + strlen(filename) + 1);
|
||||||
if (!n)
|
if (!n)
|
||||||
{
|
{
|
||||||
eina_lock_release(&_eina_file_lock_cache);
|
eina_lock_release(&_eina_file_lock_cache);
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(n, 0, sizeof(Eina_File));
|
||||||
n->filename = (char*) (n + 1);
|
n->filename = (char*) (n + 1);
|
||||||
strcpy((char*) n->filename, filename);
|
strcpy((char*) n->filename, filename);
|
||||||
n->map = eina_hash_new(EINA_KEY_LENGTH(_eina_file_map_key_length),
|
n->map = eina_hash_new(EINA_KEY_LENGTH(_eina_file_map_key_length),
|
||||||
|
@ -1006,7 +1007,6 @@ eina_file_open(const char *path, Eina_Bool shared)
|
||||||
3);
|
3);
|
||||||
n->rmap = eina_hash_pointer_new(NULL);
|
n->rmap = eina_hash_pointer_new(NULL);
|
||||||
n->global_map = MAP_FAILED;
|
n->global_map = MAP_FAILED;
|
||||||
n->global_refcount = 0;
|
|
||||||
n->length = file_stat.st_size;
|
n->length = file_stat.st_size;
|
||||||
n->mtime = file_stat.st_mtime;
|
n->mtime = file_stat.st_mtime;
|
||||||
#ifdef _STAT_VER_LINUX
|
#ifdef _STAT_VER_LINUX
|
||||||
|
@ -1017,11 +1017,8 @@ eina_file_open(const char *path, Eina_Bool shared)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
n->inode = file_stat.st_ino;
|
n->inode = file_stat.st_ino;
|
||||||
n->refcount = 0;
|
|
||||||
n->fd = fd;
|
n->fd = fd;
|
||||||
n->shared = shared;
|
n->shared = shared;
|
||||||
n->delete_me = EINA_FALSE;
|
|
||||||
n->global_faulty = EINA_FALSE;
|
|
||||||
eina_lock_new(&n->lock);
|
eina_lock_new(&n->lock);
|
||||||
eina_hash_direct_add(_eina_file_cache, n->filename, n);
|
eina_hash_direct_add(_eina_file_cache, n->filename, n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -942,6 +942,7 @@ eina_file_open(const char *path, Eina_Bool shared)
|
||||||
goto close_fm;
|
goto close_fm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(n, 0, sizeof(Eina_File));
|
||||||
n->filename = (char*) (n + 1);
|
n->filename = (char*) (n + 1);
|
||||||
strcpy((char*) n->filename, filename);
|
strcpy((char*) n->filename, filename);
|
||||||
n->map = eina_hash_new(EINA_KEY_LENGTH(_eina_file_map_key_length),
|
n->map = eina_hash_new(EINA_KEY_LENGTH(_eina_file_map_key_length),
|
||||||
|
@ -951,14 +952,11 @@ eina_file_open(const char *path, Eina_Bool shared)
|
||||||
3);
|
3);
|
||||||
n->rmap = eina_hash_pointer_new(NULL);
|
n->rmap = eina_hash_pointer_new(NULL);
|
||||||
n->global_map = MAP_FAILED;
|
n->global_map = MAP_FAILED;
|
||||||
n->global_refcount = 0;
|
|
||||||
n->length = length.QuadPart;
|
n->length = length.QuadPart;
|
||||||
n->mtime = mtime.QuadPart;
|
n->mtime = mtime.QuadPart;
|
||||||
n->refcount = 0;
|
|
||||||
n->handle = handle;
|
n->handle = handle;
|
||||||
n->fm = fm;
|
n->fm = fm;
|
||||||
n->shared = shared;
|
n->shared = shared;
|
||||||
n->delete_me = EINA_FALSE;
|
|
||||||
eina_lock_new(&n->lock);
|
eina_lock_new(&n->lock);
|
||||||
eina_hash_direct_add(_eina_file_cache, n->filename, n);
|
eina_hash_direct_add(_eina_file_cache, n->filename, n);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue