From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Campbell Subject: Re: [PATCH] eal: clear errno before calling strtoull() to parse base_virtaddr Date: Thu, 19 Jun 2014 12:50:53 -0300 Message-ID: References: <1403192557-10905-1-git-send-email-aaron@arbor.net> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: "dev-VfR2kkLFssw@public.gmane.org" To: "Burakov, Anatoly" Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Yes, that was extremely bizarre. I didn=92t check the whole project, = but at least eal_parse_socket_mem() in the same file was already = correct. Pablo you can add me to Acked-by, obviously. :-) -Aaron On Jun 19, 2014, at 12:46 PM, Burakov, Anatoly = wrote: > Hi Aaron, >=20 > It seems that Pablo De Lara has beat you to it by a few minutes :-) = Are there any other places this could potentially happen? >=20 >> Must reset errno to zero before calling strtoull(), else on success = it could be >> any arbitrary value from past errors. >>=20 >> Signed-off-by: Aaron Campbell >> --- >> lib/librte_eal/linuxapp/eal/eal.c | 1 + >> 1 file changed, 1 insertion(+) >>=20 >> diff --git a/lib/librte_eal/linuxapp/eal/eal.c = b/lib/librte_eal/linuxapp/eal/eal.c >> index 6994303..d204387 100644 >> --- a/lib/librte_eal/linuxapp/eal/eal.c >> +++ b/lib/librte_eal/linuxapp/eal/eal.c >> @@ -562,6 +562,7 @@ eal_parse_base_virtaddr(const char *arg) >> char *end; >> uint64_t addr; >>=20 >> + errno =3D 0; >> addr =3D strtoull(arg, &end, 16); >>=20 >> /* check for errors */ >> -- >> 1.8.3.2 >=20