Re: [PATCH] entry.c: Use strerror() to print error info when possible

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

 



"Luiz Fernando N. Capitulino" <lcapitulino@xxxxxxxxxxxxxxx>
writes:

> Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@xxxxxxxxxxxxxxx>
> ---
>  entry.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/entry.c b/entry.c
> index d72f811..c36c09d 100644
> --- a/entry.c
> +++ b/entry.c
> @@ -19,7 +19,8 @@ static void create_directories(const char *path, struct checkout *state)
>  				if (!stat(buf, &st) && S_ISDIR(st.st_mode))
>  					continue; /* ok */
>  			}
> -			die("cannot create directory at %s", buf);
> +			die("cannot create directory at %s (%s)", buf,
> +			    strerror(errno));
>  		}
>  	}
>  	free(buf);

This hunk is wrong; stat() you see in the context could have
been what failed the last before this die().

I do not think other places you patched do not share the issue.




-
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]