[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 7/7] libxl: libxl_tmem functions improving coding style
On Wed, 2016-04-27 at 15:31 +0100, Wei Liu wrote: > On Wed, Apr 20, 2016 at 11:04:06PM +0200, Olaf Hering wrote: > > > > On Wed, Apr 20, Paulina Szubarczyk wrote: > > > > > > > > In accordance with CODING_SYTLE: > > > - Use 'r' for return values to functions whose return values are > > > a > > > different error space (like xc_tmem_control, xc_tmem_auth) > > > > > > libxc functions are supposed to, on failure, set errno and alwas > > > return -1 > > > which is the value stored in 'r', therfore use LOG() instead > > > LOGEV() > > > with the 'r' value since the error code is always -1. > > Shouldnt in this case 'LOGEV' be replaced with 'LOGE' to get errno > > printed? Plain 'LOG' does not seem to print errno. > > > Agreed. We should use LOGEV here. > You mean LOGE, don't you? :-) I think it was me that suggested dropping LOGEV in favour of LOG, and I agree that I should have suggested LOGE. Sorry for that. TBF, I seem to find both cases in libxl source code (i.e., we use both LOG and LOGE to log error after an xc_* call), but I agree that, since libxc sets errno, LOGE is the better, and we should try to converge to always using that one. 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) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |