efreet: don't raise ERR on empty file in efreet_xml_new()

this is not an error, there is nothing to parse

@fix
This commit is contained in:
Mike Blumenkrantz 2017-06-16 15:03:09 -04:00
parent abe4c8d772
commit b6b0b1b5b2
1 changed files with 6 additions and 0 deletions

View File

@ -96,6 +96,12 @@ efreet_xml_new(const char *file)
if (fd == -1) goto efreet_error;
if (fstat(fd, &st) < 0) goto efreet_error;
/* empty file: not an error */
if (!st.st_size)
{
close(fd);
return NULL;
}
/* let's make mmap safe and just get 0 pages for IO erro */
eina_mmap_safety_enabled_set(EINA_TRUE);