From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] xl: log an error if libxl_cpupool_destroy() fails Date: Fri, 23 Oct 2015 17:12:50 +0200 Message-ID: <1445613170.5117.139.camel@citrix.com> References: <20151022171420.15122.92760.stgit@Solace.station> <20151023084326.GN5060@zion.uk.xensource.com> <1445609376.2374.192.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4498768317747157172==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zpe1a-0007S2-Mp for xen-devel@lists.xenproject.org; Fri, 23 Oct 2015 15:12:58 +0000 In-Reply-To: <1445609376.2374.192.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Wei Liu , Ian Jackson Cc: Juergen Gross , xen-devel@lists.xenproject.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org --===============4498768317747157172== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-IoXswUXj4AJvJTn+6zqX" --=-IoXswUXj4AJvJTn+6zqX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-10-23 at 15:09 +0100, Ian Campbell wrote: > On Fri, 2015-10-23 at 09:43 +0100, Wei Liu wrote: > Looking at those links, I'm not sure that either you or myself was > thinking > of using EXIT_* as function return values, just that the eventual > process > exit would become one of those values instead of some negative > number. > Exactly. > Although the thread doesn't look like it is too clear if it is > talking > about return values from functions vs. process exit codes. >=20 Well, independently from the thread, I certainly meant that I think EXIT_* should be used as process exit status, not as internal functions' return value. > I think what I would have been expecting is for the xl internal error > code > would become EXIT_* either in the call to exit() or the return from > main > instead of being the process exit code directly. >=20 But, in this specific case, and in cases of main_foo() functions in xl_cmdimpl.c, it's exactly like that, isn't it? ... if (cspec) { if (dryrun_only && !cspec->can_dryrun) { fprintf(stderr, "command does not implement -N (dryrun) option\= n"); ret =3D 1; goto xit; } ret =3D cspec->cmd_impl(argc, argv); } else if (!strcmp(cmd, "help")) { help(argv[1]); ret =3D 0; } else { fprintf(stderr, "command not implemented\n"); ret =3D 1; } xit: return ret; } (from main() in xl.c) > Seeing "return EXIT_FOO" outside of a main function seems rather > strange to > me. >=20 Well, same here. Except, given xl architecture, I was considering main_foo() functions in xl_cmdimpl.c as some king of extensions of the actual main function. The alternative would be to always use, say, 0 and 1 in xl_cmdimpl.c, and then convert them to EXIT_SUCCESS or EXIT_FAILURE in xl.c (for return-s, of course, exit()-s need to use them no matter where they are). I'm fine with either, so, if you prefer the latter, I certainly can arrange for doing things that way. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-IoXswUXj4AJvJTn+6zqX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlYqTnMACgkQk4XaBE3IOsTGXgCfcTB+l2CZrBql5oJ1Sa/t0UqL co4AnjkcV18qvSptj/5b0EK5wSCY6qUi =+daR -----END PGP SIGNATURE----- --=-IoXswUXj4AJvJTn+6zqX-- --===============4498768317747157172== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============4498768317747157172==--