Re: [PATCH 63/83] builtin/apply: make apply_all_patches() return -1 on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 24, 2016 at 8:34 PM, Christian Couder
<christian.couder@xxxxxxxxx> wrote:
>         if (state->update_index) {
>                 if (write_locked_index(&the_index, state->lock_file, COMMIT_LOCK))
> -                       die(_("Unable to write new index file"));
> +                       return error(_("Unable to write new index file"));
>         }
>
>         return !!errs;
> @@ -4698,5 +4698,8 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
>         if (check_apply_state(&state, force_apply))
>                 exit(1);
>
> -       return apply_all_patches(&state, argc, argv, options);
> +       if (apply_all_patches(&state, argc, argv, options))
> +               exit(1);

Abusing exit() too much? This is cmd_apply(). A return should be
enough and you can do the !! trick that is used in
apply_all_patches(), shown just a little bit above.

> +
> +       return 0;
>  }
> --
> 2.8.1.300.g5fed0c0
>



-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]