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

Liu Yuan namei.unix at gmail.com
Wed Jul 11 04:16:53 CEST 2012


On 07/10/2012 05:02 PM, levin li wrote:
>  out:
>  	if (fd > 0)
>  		close(fd);
>  	return buf;
> +err:
> +	free(buf);
> +	close(fd);
> +	return NULL;

This is better to reorder as:

	in err:
		free(buf);
		buf = NULL;
		goto out_close;
	....
	
out_close:
	close(fd);
out:
	return buf;

Thanks,
Yuan




More information about the sheepdog mailing list