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

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to