Le 15/10/2012 10:03, Vincent Torri a écrit :
> Maxime: you can separate code with the  _WIN32 macro. Can you update
> ecore and write a patch that use lstat on non win32 ?
Ok.
--- ecore_file.c	2012-10-15 18:53:22.594116119 +0200
+++ ecore_file.c	2012-10-15 18:52:46.668671104 +0200
@@ -399,22 +399,27 @@
 EAPI Eina_Bool
 ecore_file_recursive_rm(const char *dir)
 {
-   Eina_Iterator *it;
-   char buf[PATH_MAX];
    struct stat st;
-   int ret;
+
+#ifdef _WIN32
+   char buf[PATH_MAX];
 
    if (readlink(dir, buf, sizeof(buf) - 1) > 0)
      return ecore_file_unlink(dir);
+   if (stat(dir, &st) == -1)
+     return EINA_FALSE;
+#else
+   if (lstat(dir, &st) == -1)
+     return EINA_FALSE;
+#endif
 
-   ret = stat(dir, &st);
-   if ((ret == 0) && (S_ISDIR(st.st_mode)))
+   if (S_ISDIR(st.st_mode))
      {
         Eina_File_Direct_Info *info;
+        Eina_Iterator *it;
+        int ret;
 
         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)
           {
@@ -431,7 +436,6 @@
      }
    else
      {
-        if (ret == -1) return EINA_FALSE;
         return ecore_file_unlink(dir);
      }
 }
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to