On Wed, 2016-04-06 at 13:46 +0200, Paulina Szubarczyk wrote: > From: George Dunlap <george.dun...@eu.citrix.com> > > Returning error codes makes it easier for shell scripts to tell if a > command has failed or succeeded. > > NB this violates the CODING_STYLE preference for not initializing the > return-value variable at declaration; but in these cases, having a > "goto out" that jumped over nothing but an "r = 0" seemed > a bit pointless. > AFAIUI, that rule applies to 'int rc' variables, meant at hosting libxl error codes and not equally strictly (although it might be a nice to have) to 'int r' and alike variables meant at hosting return code from interna functions, syscalls, libxc calls, etc.
Unless I'm missing or misreading something from libxl's CODING_STYLE. :-) > Signed-off-by: George Dunlap <george.dun...@eu.citrix.com> > Signed-off-by: Paulina Szubarczyk <paulinaszubarc...@gmail.com> > > --- > Changed since v1: > * Changed exit() calls to 'return 1;' > Why do we need to do that? changing exit(<random_number>) in either exit(EXIT_SUCCESS) or (in most of the cases) exit(EXIT_FAILURE) is much better, and is the patter we're (slowly :-/) trying to force into xl. Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel