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)
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)
170 { 170 {
171 char *currentdir; 171 char *currentdir;
172 sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR); 172 sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR);
173 if (mkdir(origdir, 0744) < 0) 173 if (!ecore_file_exists(origdir))
174 { 174 {
175 fprintf(stderr, "Failed to create dir %s\n", origdir); 175 if (mkdir(origdir, 0744) < 0)
176 return; 176 {
177 fprintf(stderr, "Failed to create dir %s\n", origdir);
178 return;
179 }
177 } 180 }
178 _exu_imgs_unpack(path, origdir, ent->name); 181 _exu_imgs_unpack(path, origdir, ent->name);
179 sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, ent->name); 182 sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, ent->name);
@@ -536,11 +539,14 @@ main(int argc, char *argv[])
536 ret = 1; 539 ret = 1;
537 goto end; 540 goto end;
538 } 541 }
539 if (mkdir(tmp, 0744) < 0) 542 if (!ecore_file_exists(tmp))
540 { 543 {
541 fprintf(stderr, "Failed to create dir %s", tmp); 544 if (mkdir(tmp, 0744) < 0)
542 ret = 1; 545 {
543 goto end; 546 fprintf(stderr, "Failed to create dir %s", tmp);
547 ret = 1;
548 goto end;
549 }
544 } 550 }
545 } 551 }
546 else if (mode_init) 552 else if (mode_init)
@@ -553,11 +559,14 @@ main(int argc, char *argv[])
553 ret = 1; 559 ret = 1;
554 goto end; 560 goto end;
555 } 561 }
556 if (mkdir(tmp, 0744) < 0) 562 if (!ecore_file_exists(tmp))
557 { 563 {
558 fprintf(stderr, "Failed to create dir %s", tmp); 564 if (mkdir(tmp, 0744) < 0)
559 ret = 1; 565 {
560 goto end; 566 fprintf(stderr, "Failed to create dir %s", tmp);
567 ret = 1;
568 goto end;
569 }
561 } 570 }
562 } 571 }
563 else if (mode_simulation) 572 else if (mode_simulation)