[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] libxl: add a dummy ao_how to libxl_domain_core_dump
Ian Campbell writes ("Re: [PATCH] libxl: add a dummy ao_how to libxl_domain_core_dump"): > On Mon, 2012-04-16 at 16:50 +0100, Ian Jackson wrote: > > Ian Campbell writes ("[PATCH] libxl: add a dummy ao_how to > > libxl_domain_core_dump"): > > > libxl: add a dummy ao_how to libxl_domain_core_dump > > > - return ERROR_FAIL; > > > + rc = ERROR_FAIL; > > > > While you're doing that, did you want to change it to use "goto out" ? > > wouldn't the "out:" be immediately after this immediately following > closing brace? I think it would look like this: > > > + rc = ERROR_FAIL; goto out; > > > } > > > - return 0; > > > + rc = 0; out: > > > + libxl__ao_complete(egc, ao, rc); > > > + > > > + return AO_INPROGRESS; And removing the initialisation of rc at the top of the function. This pattern is the usual one when we have an operation which should fail, and stop executing, when any sub-operations fail. Setting rc=0 at the top and setting it to ERROR_FAIL as we go, without an error exit, is what we do if we want to blunder on after errors (eg the remove files patch). Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |