From 5bc0146a1d6474d339c4ade9a227f32cc27a8b93 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Sun, 13 Dec 2020 11:57:43 +0000 Subject: [PATCH] utils: simplify mkdir_p boolean conditions Just a trivial simplification. Signed-off-by: Rui Salvaterra --- 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;