[sheepdog] [PATCH 1/3] sheep/kv: initialize return code in onode_populate_data()

Liu Yuan namei.unix at gmail.com
Thu Jan 16 15:41:04 CET 2014


On Thu, Jan 16, 2014 at 04:11:02PM +0800, Robin Dong wrote:
> From: Robin Dong <sanbai at taobao.com>
> 
> When we upload a small inlined-object, the function onode_populate_data()
> will only return the variable 'ret' which has not been initialized.
> So, we should set 'ret' to SD_RES_SUCCESS firstly.
> 
> Signed-off-by: Robin Dong <sanbai at taobao.com>
> ---
>  sheep/http/kv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sheep/http/kv.c b/sheep/http/kv.c
> index dd5ca56..02d8e1b 100644
> --- a/sheep/http/kv.c
> +++ b/sheep/http/kv.c
> @@ -739,7 +739,7 @@ static uint64_t get_seconds(void)
>  static int onode_populate_data(struct kv_onode *onode, struct http_request *req)
>  {
>  	ssize_t size;
> -	int ret;
> +	int ret = SD_RES_SUCCESS;
>  
>  	if (req->data_length <= KV_ONODE_INLINE_SIZE) {
>  		onode->inlined = 1;
> -- 
> 1.7.12.4
> 

Applied this thanks

Yuan



More information about the sheepdog mailing list