[sheepdog] [PATCH UPDATE] farm: add flock in read_working_object()

Liu Yuan namei.unix at gmail.com
Wed Jul 11 04:54:27 CEST 2012


On 07/11/2012 10:41 AM, levin li wrote:
> +	goto out;
>  
> +err:
> +	free(buf);
> +	buf = NULL;
>  out:
>  	if (fd > 0)
>  		close(fd);

This looks worse than previous version. Error handling should be handled
inside the place where it is happening or we can fold it at the end of
control flow as:

normal out:
	...
	return
err out:
	...
	false return
}

Thanks
Yuan



More information about the sheepdog mailing list