On Wed, 2016-04-06 at 13:46 +0200, Paulina Szubarczyk wrote: > From: George Dunlap > > 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 > Signed-off-by: Paulina Szubarczyk > > --- > Changed since v1: > * Changed exit() calls to 'return 1;' > Why do we need to do that? changing exit() 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 -- <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)