Re: [PATCH] builtin-apply: Show a more descriptive error on failure when opening a patch

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

 



Hi,

On Sun, 13 Apr 2008, Alberto Bertogli wrote:

> diff --git a/builtin-apply.c b/builtin-apply.c
> index abe73a0..d80b231 100644
> --- a/builtin-apply.c
> +++ b/builtin-apply.c
> @@ -3120,8 +3120,11 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
>  			arg = prefix_filename(prefix, prefix_length, arg);
>  
>  		fd = open(arg, O_RDONLY);
> -		if (fd < 0)
> -			usage(apply_usage);
> +		if (fd < 0) {
> +			perror("Error opening patch");
> +			return 1;
> +		}

Would "return error("...: '%s'", arg);" not be much more appropriate and 
consistent with the resto of the source code?

Ciao,
Dscho
--
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]

  Powered by Linux