[Sheepdog] [PATCH] farm: fix lookup_trunk_entry
Liu Yuan
namei.unix at gmail.com
Sat Mar 3 05:35:18 CET 2012
On 03/02/2012 06:01 PM, Liu Yuan wrote:
> From: Liu Yuan <tailai.ly at taobao.com>
>
> It should return NULL when 1. not found and 2. create = 0.
>
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
> sheep/farm/trunk.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/sheep/farm/trunk.c b/sheep/farm/trunk.c
> index fabae8a..b9f0b3e 100644
> --- a/sheep/farm/trunk.c
> +++ b/sheep/farm/trunk.c
> @@ -92,7 +92,8 @@ not_found:
> entry = xzalloc(sizeof(*entry));
> entry->raw.oid = oid;
> get_entry(entry, head);
> - }
> + } else
> + entry = NULL;
> out:
> pthread_mutex_unlock(&hashtable_lock[h]);
> return entry;
Applied.
Thanks,
Yuan
More information about the sheepdog
mailing list