diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-27 18:43:42 +0100 |
---|---|---|
committer | Stefan Schmidt <s.schmidt@samsung.com> | 2020-03-31 13:07:47 +0200 |
commit | dcd16cb590ec5ae92f62bf6e54514e79665976a3 (patch) | |
tree | 9080c83ca30f42db5928d52b6923b2348ef93849 | |
parent | 32545f9280f8b7bac6585111db20cdab74d7b14b (diff) | |
download | efl-dcd16cb590ec5ae92f62bf6e54514e79665976a3.tar.gz |
exactness: correctly call mkdir
we should not error when mkdir returns < 0. EEXIST should not result in
the return here.
Differential Revision: https://phab.enlightenment.org/D11618
-rw-r--r-- | src/bin/exactness/exactness.c | 31 |
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) |