Re: [PATCHv2 4/5] network: change cleanup: to error: in network*() functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/14/2012 10:47 AM, Eric Blake wrote:
> On 08/14/2012 01:10 AM, Laine Stump wrote:
>> @@ -3199,8 +3198,9 @@ networkReleaseActualDevice(virDomainNetDefPtr iface)
>>                    dev->dev, dev->connections);
>>      }
>>  
>> -    ret = 0;
>>  cleanup:
>> +    ret = 0;
>> +error:
> Another case where this might make more sense:
>
> success:
>     ret = 0;
> cleanup:
>
> The cleanups are mechanical, but I'm not sure I like the resulting naming.
>

Well, I can create a new "error:" label that just does this:


 success:
   ret = 0;
 cleanup:
   /* blah blah */
   return ret;

 error:
   goto cleanup;

I do really want an explicit error: label, but also understand why you
don't want a successful exit to go past a label named "error".

respin coming up.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]