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;
|
||||
|
||||
ret = mkdir(dir, mask);
|
||||
if (!ret || (ret && errno == EEXIST))
|
||||
if (!ret || errno == EEXIST)
|
||||
return 0;
|
||||
|
||||
if (ret && (errno != ENOENT))
|
||||
|
@ -182,7 +182,7 @@ int mkdir_p(char *dir, mode_t mask)
|
|||
*l = '/';
|
||||
|
||||
ret = mkdir(dir, mask);
|
||||
if (!ret || (ret && errno == EEXIST))
|
||||
if (!ret || errno == EEXIST)
|
||||
return 0;
|
||||
else
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue