utils: simplify mkdir_p boolean conditions
Just a trivial simplification. Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
This commit is contained in:
parent
357877693c
commit
5bc0146a1d
1 changed files with 2 additions and 2 deletions
4
utils.c
4
utils.c
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue