oops - yes - windows. ugh. indeed.

SVN revision: 77985
This commit is contained in:
Carsten Haitzler 2012-10-15 08:00:31 +00:00
parent 7de4d6b72a
commit e1ada6ad4d
2 changed files with 16 additions and 9 deletions

View File

@ -56,4 +56,3 @@ Seong-ho Cho (DarkCircle) <darkcircle.0426@gmail.com>
Patryk Kaczmarek <patryk.k@samsung.com>
Daniel Willmann <d.willmann@samsung.com>
Michal Pakula vel Rutka <m.pakula@samsung.com>
Maxime Villard <rustyBSD@gmx.fr>

View File

@ -399,16 +399,21 @@ ecore_file_remove(const char *file)
EAPI Eina_Bool
ecore_file_recursive_rm(const char *dir)
{
Eina_Iterator *it;
char buf[PATH_MAX];
struct stat st;
int ret;
if (lstat(dir, &st) == -1)
return EINA_FALSE;
if (readlink(dir, buf, sizeof(buf) - 1) > 0)
return ecore_file_unlink(dir);
if (S_ISDIR(st.st_mode))
ret = stat(dir, &st);
if ((ret == 0) && (S_ISDIR(st.st_mode)))
{
Eina_File_Direct_Info *info;
Eina_Iterator *it;
int ret = 1;
ret = 1;
if (stat(dir, &st) == -1) return EINA_FALSE; /* WOOT: WHY ARE WE CALLING STAT TWO TIMES ??? */
it = eina_file_direct_ls(dir);
EINA_ITERATOR_FOREACH(it, info)
@ -424,8 +429,11 @@ ecore_file_recursive_rm(const char *dir)
else
return EINA_FALSE;
}
return ecore_file_unlink(dir);
else
{
if (ret == -1) return EINA_FALSE;
return ecore_file_unlink(dir);
}
}
static inline Eina_Bool
@ -782,7 +790,7 @@ EAPI char *
ecore_file_readlink(const char *lnk)
{
char buf[PATH_MAX];
ssize_t count;
int count;
if ((count = readlink(lnk, buf, sizeof(buf) - 1)) < 0) return NULL;
buf[count] = 0;