From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14087A034F; Mon, 6 Dec 2021 18:25:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 946D4410E5; Mon, 6 Dec 2021 18:25:02 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4B15D40040 for ; Mon, 6 Dec 2021 18:25:01 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1061) id 1735220E6AD0; Mon, 6 Dec 2021 09:25:00 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1735220E6AD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1638811500; bh=xZs4wgtlXlumZc7Rg2ss1YsoVFsa40E23DaAzJ2iEgc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pd1P2UhznI6RAP2PhNIbZQlxNJGHbG1aihKT2glxVipZshb2hgAGiEg6S+hpNBao1 gPQdPfRGCj5DCYubb5TFBtU/PXCJzxmzoDDFnfftrmQp14NQz94bG+ML8cEJ8yUmao bPDus2Ai2sMkOiD0KV4142NJ1SrRXFoVB+uiKvvs= Date: Mon, 6 Dec 2021 09:25:00 -0800 From: Jie Zhou To: Dmitry Kozlyuk Cc: dev@dpdk.org, roretzla@microsoft.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net, aconole@redhat.com Subject: Re: [PATCH v11 6/9] app/test: differentiate a strerror on different OS Message-ID: <20211206172500.GA19613@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1638384245-12587-1-git-send-email-jizh@linux.microsoft.com> <1638490007-9939-1-git-send-email-jizh@linux.microsoft.com> <1638490007-9939-7-git-send-email-jizh@linux.microsoft.com> <20211204043337.3a244224@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211204043337.3a244224@sovereign> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Sat, Dec 04, 2021 at 04:33:37AM +0300, Dmitry Kozlyuk wrote: > 2021-12-02 16:06 (UTC-0800), Jie Zhou: > > On Windows, strerror returns just "Unknown error" for errnum greater > > than MAX_ERRNO, while linux and freebsd returns "Unknown error ", > > which is the current expectation for errno_autotest. Differentiate > > the error string on Windows to remove a "duplicate error code" failure. > > > > Signed-off-by: Jie Zhou > > > > --- > > app/test/test_errno.c | 12 +++++++++++- > > lib/eal/common/eal_common_errno.c | 4 ++++ > > 2 files changed, 15 insertions(+), 1 deletion(-) > [...] > > diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c > > index f86802705a..4c4abb802e 100644 > > --- a/lib/eal/common/eal_common_errno.c > > +++ b/lib/eal/common/eal_common_errno.c > > @@ -37,7 +37,11 @@ rte_strerror(int errnum) > > /* since some implementations of strerror_r throw an error > > * themselves if errnum is too big, we handle that case here */ > > if (errnum >= RTE_MAX_ERRNO) > > +#ifdef RTE_EXEC_ENV_WINDOWS > > + snprintf(ret, RETVAL_SZ, "Unknown error%s", sep); > > "sep" is not needed here, is it? Yes, it is unnecessary. Removed. Thanks for spotting it. > > > +#else > > snprintf(ret, RETVAL_SZ, "Unknown error%s %d", sep, errnum); > > +#endif > > else > > switch (errnum){ > > case E_RTE_SECONDARY: