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
This commit is contained in:
Marcel Hollerbach 2020-03-27 18:43:42 +01:00 committed by Stefan Schmidt
parent 830d45e384
commit 624ea389c9
1 changed files with 20 additions and 11 deletions

View File

@ -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)