From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id DC55023D; Wed, 31 Oct 2018 18:16:15 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5D89E22390; Wed, 31 Oct 2018 13:16:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 31 Oct 2018 13:16:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=qfBrCPQdqqdDdZFgZahFcVHdSATE8dHoQ9omDHvd19Y=; b=hsrG4OEzJ6bW hUT4qeFFX2lABFztHJfrpYW/U6wVbJWvoxoDDJGURw37oHQubnqmk4n9RUoMqyu0 G44O8KmU0NIqtAhAZA77VyU1cQXkpSN2qOoQnHny1wwRwqmYmOhSWvJLmwmP4uRC mi1adMds9MGvNrra9DZN6mcSCbAVXzA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=qfBrCPQdqqdDdZFgZahFcVHdSATE8dHoQ9omDHvd1 9Y=; b=mSQZPGtfhRr8HQC9IXw00H8o3DRVNJttlEbk/qComqw3YLWzLGR0z2JDh xRNmHdZzDAELGqXdUreVDpOcXE5h+P1MdRl1m8dSdy8HWmJsu4K23LY0HQBTyPYp 9j8ARjUZR4/QUsh8SCKhg5c+L+XnK/e7hRggXdhLOkJBWrvLSNnr2c5wU9TCdhLV +qn8Q2GW35X8pSTRchHB441AXVwxAD9PlESa+DMud1oJVnf/n1Oipz1yCdhLS1y5 Q542NmCyhxfSxVGZ6WFHS7NDhmdkRT59WUnjZQ++8ypJPJNQY98G2jGnz+qJepMQ eEXhT/wRQRhAJlwTGv3bFsOILEtjA== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 311E8E4430; Wed, 31 Oct 2018 13:16:14 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, Bruce Richardson , stable@dpdk.org Date: Wed, 31 Oct 2018 18:16:20 +0100 Message-ID: <5469782.njCRi2Lb0J@xps> In-Reply-To: <20181031171928.61110-1-ferruh.yigit@intel.com> References: <20181031171928.61110-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: fix API to get error string X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 17:16:16 -0000 31/10/2018 18:19, Ferruh Yigit: > rte_strerror uses strerror_r(), and strerror_r() has two version of it. > - XSI-compliant version, (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE > - GNU-specific version > > Those two has different return types, so the exiting return type check > is not correct for GNU-specific version. > > And this is causing failure in errno_autotest unit test. > > Adding different implementation for FreeBSD and Linux. > > Fixes: 016c32bd3e3d ("eal: cleanup strerror function") > Cc: stable@dpdk.org > > Signed-off-by: Ferruh Yigit > --- > --- a/lib/librte_eal/common/eal_common_errno.c > +++ b/lib/librte_eal/common/eal_common_errno.c > default: > +#ifdef RTE_EXEC_ENV_BSDAPP > if (strerror_r(errnum, ret, RETVAL_SZ) != 0) > snprintf(ret, RETVAL_SZ, "Unknown error%s %d", > sep, errnum); > +#else > + /* > + * _GNU_SOURCE version, error string is not always > + * strored in "ret" buffer, need to use return value > + */ > + ret = strerror_r(errnum, ret, RETVAL_SZ); > +#endif Why not use the return value in both cases? Why not writing an error message in Linux case?