[PATCH] utils: simplify mkdir_p boolean conditions
Rui Salvaterra
rsalvaterra at gmail.com
Sun Dec 13 06:57:43 EST 2020
Just a trivial simplification.
Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils.c b/utils.c
index db63238..82af887 100644
--- a/utils.c
+++ b/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;
--
2.29.2
More information about the openwrt-devel
mailing list