[pacman-dev] [PATCH] lib/libalpm/handle.c: Removed redudant if condition

Dan McGee dpmcgee at gmail.com
Mon Aug 29 18:48:42 EDT 2011


s/redududant/redundant/, and I reworked the commit message as it just
duplicated SUBJECT, but otherwise thanks!

On Mon, Aug 29, 2011 at 4:07 PM, Helder Martins
<heldermartins89 at gmail.com> wrote:
> Removed redudant if condition in lib/libalpm/handle.c, _alpm_handle_unlock()
>
> Signed-off-by: Helder Martins <heldermartins89 at gmail.com>
> ---
>  lib/libalpm/handle.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
> index 266b4bc..b9d71db 100644
> --- a/lib/libalpm/handle.c
> +++ b/lib/libalpm/handle.c
> @@ -132,10 +132,9 @@ int _alpm_handle_unlock(alpm_handle_t *handle)
>        ASSERT(handle->lockfile != NULL, return -1);
>        ASSERT(handle->lckstream != NULL, return 0);
>
> -       if(handle->lckstream != NULL) {
> -               fclose(handle->lckstream);
> -               handle->lckstream = NULL;
> -       }
> +       fclose(handle->lckstream);
> +       handle->lckstream = NULL;
> +
>        if(unlink(handle->lockfile) && errno != ENOENT) {
>                return -1;
>        }
> --
> 1.7.6.1
>
>
>


More information about the pacman-dev mailing list