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 CF35FA0C41; Sat, 4 Dec 2021 02:33:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E76C4013F; Sat, 4 Dec 2021 02:33:40 +0100 (CET) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id 200C040041 for ; Sat, 4 Dec 2021 02:33:39 +0100 (CET) Received: by mail-lf1-f52.google.com with SMTP id n12so10661467lfe.1 for ; Fri, 03 Dec 2021 17:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/gzxBNP/F5KL7P0R8UFJEFCCkCvbsDJc+k+nn9uDMYM=; b=LnQv0c7NL9TK9UE2RrwMlv+vuHbGesp3ZXdhHyC2DSMOISb+zE5UVlLfQQLgsPsNcg WY9/X4mFN/FxNvwAgHKZ/UeqjxDfRctIa4Ie2J/oZgZwHfmEQgGXypUUjBrVctGH598+ NSY6hkpGEZdxcdZoYzJNwJcR1h56aNgOt8+FH7FBoxGvEf5PJ9FJsLqmhcJ/0Xp2KHMS BqcakH/ck+eeYwygVeMVZO4hdaQXkEYy5n8UUm6X60cpVTGqEBGj9RHaL3tLjTLMPJ+5 vgm5Wpftnmf46EpPwfm7pq0jKev8Uzv6WpW184a/BTaz+G6GrIb+hLudEQqeixWhpmH8 DwFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/gzxBNP/F5KL7P0R8UFJEFCCkCvbsDJc+k+nn9uDMYM=; b=4fatv0uB4vT3tWaK/yqGkQz1Yqv2IiRu0LMy7c0KRbbb0bYDkM0s3UnwayPMXqMBiK a9dcx4o2MozUD1zBd6ftIqce/zfMPPxEC417z2fEVKoaPvUKyyFmXm9fc1VHwkj5jqsz +ubeYQkFFZ8cpMNLgJoLwILJUPrPWy3ptHr1FVo7eWqonXBWwSDPhDGPh4LF9pID5fvd 6UfDsS55qm8pyFNJhM6C+dUwyMon+7ZjEsgHYyAJ7B0qZW2CgQsY9cCA7EM8gyl9bYSe cfvnjqL7+rrXLPMHiW9yXB3ItluoS1SKCQiIqrW4q+6KkUlvclMgocKyI+hy8lZBY58Q VKwg== X-Gm-Message-State: AOAM531aizTWOqr/kiysVrTcTcxwwBmEu/h1Ijee2hQM/w5fD9X+rqYO zROQr3c/Zn3r2A2PIsyLVrY= X-Google-Smtp-Source: ABdhPJwdpRaXSacYVEcT4R8+1dixmaT0gUckG7a8LdJ4lJaAf7JMNIRxrOtHTCOTjrY/kc+gxN1i7w== X-Received: by 2002:a05:6512:3fa5:: with SMTP id x37mr20914717lfa.536.1638581618542; Fri, 03 Dec 2021 17:33:38 -0800 (PST) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id q15sm570207lfp.32.2021.12.03.17.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 17:33:38 -0800 (PST) Date: Sat, 4 Dec 2021 04:33:37 +0300 From: Dmitry Kozlyuk To: Jie Zhou 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: <20211204043337.3a244224@sovereign> In-Reply-To: <1638490007-9939-7-git-send-email-jizh@linux.microsoft.com> 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> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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? > +#else > snprintf(ret, RETVAL_SZ, "Unknown error%s %d", sep, errnum); > +#endif > else > switch (errnum){ > case E_RTE_SECONDARY: