utils: simplify mkdir_p boolean conditions

Just a trivial simplification.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
This commit is contained in:
Rui Salvaterra 2020-12-13 11:57:43 +00:00 committed by Daniel Golle
parent 357877693c
commit 5bc0146a1d

View file

@ -164,7 +164,7 @@ int mkdir_p(char *dir, mode_t mask)
int ret; int ret;
ret = mkdir(dir, mask); ret = mkdir(dir, mask);
if (!ret || (ret && errno == EEXIST)) if (!ret || errno == EEXIST)
return 0; return 0;
if (ret && (errno != ENOENT)) if (ret && (errno != ENOENT))
@ -182,7 +182,7 @@ int mkdir_p(char *dir, mode_t mask)
*l = '/'; *l = '/';
ret = mkdir(dir, mask); ret = mkdir(dir, mask);
if (!ret || (ret && errno == EEXIST)) if (!ret || errno == EEXIST)
return 0; return 0;
else else
return -1; return -1;