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

levin li levin108 at gmail.com
Wed Jul 11 05:13:51 CEST 2012


On 2012年07月11日 10:54, Liu Yuan wrote:
> 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
> 

Ah, a little confusing, it's indeed what I did in my first version.

thanks,

levin




More information about the sheepdog mailing list