stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=624ea389c932271fffbc260ada29a2dbadd51603

commit 624ea389c932271fffbc260ada29a2dbadd51603
Author: Marcel Hollerbach <[email protected]>
Date:   Fri Mar 27 18:43:42 2020 +0100

    exactness: correctly call mkdir
    
    we should not error when mkdir returns < 0. EEXIST should not result in
    the return here.
    
    Reviewed-by: Stefan Schmidt <[email protected]>
    Reviewed-by: Mike Blumenkrantz <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11618
---
 src/bin/exactness/exactness.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c
index 79fefa8330..8338c12cd5 100644
--- a/src/bin/exactness/exactness.c
+++ b/src/bin/exactness/exactness.c
@@ -170,10 +170,13 @@ _run_test_compare(const List_Entry *ent)
           {
              char *currentdir;
              sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, 
ORIG_SUBDIR);
-             if (mkdir(origdir, 0744) < 0)
+             if (!ecore_file_exists(origdir))
                {
-                  fprintf(stderr, "Failed to create dir %s\n", origdir);
-                  return;
+                  if (mkdir(origdir, 0744) < 0)
+                    {
+                       fprintf(stderr, "Failed to create dir %s\n", origdir);
+                       return;
+                    }
                }
              _exu_imgs_unpack(path, origdir, ent->name);
              sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, 
ent->name);
@@ -536,11 +539,14 @@ main(int argc, char *argv[])
              ret = 1;
              goto end;
           }
-        if (mkdir(tmp, 0744) < 0)
+        if (!ecore_file_exists(tmp))
           {
-             fprintf(stderr, "Failed to create dir %s", tmp);
-             ret = 1;
-             goto end;
+             if (mkdir(tmp, 0744) < 0)
+               {
+                  fprintf(stderr, "Failed to create dir %s", tmp);
+                  ret = 1;
+                  goto end;
+               }
           }
      }
    else if (mode_init)
@@ -553,11 +559,14 @@ main(int argc, char *argv[])
              ret = 1;
              goto end;
           }
-        if (mkdir(tmp, 0744) < 0)
+        if (!ecore_file_exists(tmp))
           {
-             fprintf(stderr, "Failed to create dir %s", tmp);
-             ret = 1;
-             goto end;
+             if (mkdir(tmp, 0744) < 0)
+               {
+                  fprintf(stderr, "Failed to create dir %s", tmp);
+                  ret = 1;
+                  goto end;
+               }
           }
      }
    else if (mode_simulation)

-- 


Reply via email to