summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-27 18:43:42 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2020-03-31 14:56:41 +0200
commit624ea389c932271fffbc260ada29a2dbadd51603 (patch)
treea559e2e432a0f9db6f74c0e9d90fc623a357e09c
parent830d45e384b79690a27486c28822431efd6d09e2 (diff)
downloadefl-624ea389c932271fffbc260ada29a2dbadd51603.tar.gz
exactness: correctly call mkdir
we should not error when mkdir returns < 0. EEXIST should not result in the return here. Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11618
-rw-r--r--src/bin/exactness/exactness.c31
1 files 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)