summaryrefslogtreecommitdiff
path: root/src/bin/exactness
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2020-02-26 15:07:12 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2020-03-02 17:06:15 +0100
commitc6dba86e4c464a25b965f1029f670de2828ddb68 (patch)
treef530072c98c918f64e13a4d0093b8c1ec31d8a1e /src/bin/exactness
parent7499bf9ba2b7ecd775dda8c039199673f9cfe944 (diff)
exactness: check success of mkdir
Evaluate return code of mkdir() and print error if it fails. CID: 1419844 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11429
Diffstat (limited to 'src/bin/exactness')
-rw-r--r--src/bin/exactness/exactness.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c
index 04301f5fd2..9214236045 100644
--- a/src/bin/exactness/exactness.c
+++ b/src/bin/exactness/exactness.c
@@ -184,7 +184,11 @@ _run_test_compare(const List_Entry *ent)
184 { 184 {
185 char *currentdir; 185 char *currentdir;
186 sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR); 186 sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR);
187 mkdir(origdir, 0744); 187 if (mkdir(origdir, 0744) < 0)
188 {
189 fprintf(stderr, "Failed to create dir %s\n", origdir);
190 return;
191 }
188 _exu_imgs_unpack(path, origdir, ent->name); 192 _exu_imgs_unpack(path, origdir, ent->name);
189 sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, ent->name); 193 sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, ent->name);
190 currentdir = alloca(strlen(_dest_dir) + 20); 194 currentdir = alloca(strlen(_dest_dir) + 20);
@@ -561,7 +565,12 @@ main(int argc, char *argv[])
561 ret = 1; 565 ret = 1;
562 goto end; 566 goto end;
563 } 567 }
564 mkdir(tmp, 0744); 568 if (mkdir(tmp, 0744) < 0)
569 {
570 fprintf(stderr, "Failed to create dir %s", tmp);
571 ret = 1;
572 goto end;
573 }
565 } 574 }
566 else if (mode_init) 575 else if (mode_init)
567 { 576 {
@@ -573,7 +582,12 @@ main(int argc, char *argv[])
573 ret = 1; 582 ret = 1;
574 goto end; 583 goto end;
575 } 584 }
576 mkdir(tmp, 0744); 585 if (mkdir(tmp, 0744) < 0)
586 {
587 fprintf(stderr, "Failed to create dir %s", tmp);
588 ret = 1;
589 goto end;
590 }
577 } 591 }
578 else if (mode_simulation) 592 else if (mode_simulation)
579 { 593 {