[sheepdog] [PATCH RESEND 4/6] farm: add sha1_file_exist() to sha1_file.c

Liu Yuan namei.unix at gmail.com
Thu Jun 6 09:52:58 CEST 2013


On 06/05/2013 06:35 PM, Kai Zhang wrote:
> +bool sha1_file_exist(const unsigned char *sha1)
> +{
> +	return (access(sha1_to_path(sha1), R_OK) == 0);
> +}
> +

sha1_to_path() isn't thread_safe. We need to

static __thread buf[]

to make it thread safe in this patch.

Thanks,
Yuan



More information about the sheepdog mailing list