summaryrefslogtreecommitdiff
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
parent7499bf9ba2b7ecd775dda8c039199673f9cfe944 (diff)
downloadefl-c6dba86e4c464a25b965f1029f670de2828ddb68.tar.gz
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
-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)
{
char *currentdir;
sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR);
- mkdir(origdir, 0744);
+ 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);
currentdir = alloca(strlen(_dest_dir) + 20);
@@ -561,7 +565,12 @@ main(int argc, char *argv[])
ret = 1;
goto end;
}
- mkdir(tmp, 0744);
+ if (mkdir(tmp, 0744) < 0)
+ {
+ fprintf(stderr, "Failed to create dir %s", tmp);
+ ret = 1;
+ goto end;
+ }
}
else if (mode_init)
{
@@ -573,7 +582,12 @@ main(int argc, char *argv[])
ret = 1;
goto end;
}
- mkdir(tmp, 0744);
+ if (mkdir(tmp, 0744) < 0)
+ {
+ fprintf(stderr, "Failed to create dir %s", tmp);
+ ret = 1;
+ goto end;
+ }
}
else if (mode_simulation)
{