[PATCH] utils: simplify mkdir_p boolean conditions
Paul Spooren
mail at aparcar.org
Mon Dec 14 03:13:47 EST 2020
Please add the specific project to the subject like [PATCH foobar]
On So, Dez 13, 2020 at 11:57, Rui Salvaterra <rsalvaterra at gmail.com>
wrote:
> 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
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list