* [PATCH] eal: clear errno before calling strtoull() to parse base_virtaddr @ 2014-06-19 15:42 Aaron Campbell [not found] ` <1403192557-10905-1-git-send-email-aaron-rd7evPjynkNeoWH0uzbU5w@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Aaron Campbell @ 2014-06-19 15:42 UTC (permalink / raw) To: dev-VfR2kkLFssw Must reset errno to zero before calling strtoull(), else on success it could be any arbitrary value from past errors. Signed-off-by: Aaron Campbell <aaron-rd7evPjynkNeoWH0uzbU5w@public.gmane.org> --- lib/librte_eal/linuxapp/eal/eal.c | 1 + 1 file changed, 1 insertion(+) 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; + errno = 0; addr = strtoull(arg, &end, 16); /* check for errors */ -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <1403192557-10905-1-git-send-email-aaron-rd7evPjynkNeoWH0uzbU5w@public.gmane.org>]
* Re: [PATCH] eal: clear errno before calling strtoull() to parse base_virtaddr [not found] ` <1403192557-10905-1-git-send-email-aaron-rd7evPjynkNeoWH0uzbU5w@public.gmane.org> @ 2014-06-19 15:46 ` Burakov, Anatoly [not found] ` <C6ECDF3AB251BE4894318F4E451236976CC9D71C-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Burakov, Anatoly @ 2014-06-19 15:46 UTC (permalink / raw) To: Aaron Campbell, dev-VfR2kkLFssw@public.gmane.org Hi Aaron, It seems that Pablo De Lara has beat you to it by a few minutes :-) Are there any other places this could potentially happen? > Must reset errno to zero before calling strtoull(), else on success it could be > any arbitrary value from past errors. > > Signed-off-by: Aaron Campbell <aaron-rd7evPjynkNeoWH0uzbU5w@public.gmane.org> > --- > lib/librte_eal/linuxapp/eal/eal.c | 1 + > 1 file changed, 1 insertion(+) > > 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; > > + errno = 0; > addr = strtoull(arg, &end, 16); > > /* check for errors */ > -- > 1.8.3.2 ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <C6ECDF3AB251BE4894318F4E451236976CC9D71C-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] eal: clear errno before calling strtoull() to parse base_virtaddr [not found] ` <C6ECDF3AB251BE4894318F4E451236976CC9D71C-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2014-06-19 15:50 ` Aaron Campbell 0 siblings, 0 replies; 3+ messages in thread From: Aaron Campbell @ 2014-06-19 15:50 UTC (permalink / raw) To: Burakov, Anatoly; +Cc: dev-VfR2kkLFssw@public.gmane.org Yes, that was extremely bizarre. I didn’t 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 <anatoly.burakov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote: > Hi Aaron, > > It seems that Pablo De Lara has beat you to it by a few minutes :-) Are there any other places this could potentially happen? > >> Must reset errno to zero before calling strtoull(), else on success it could be >> any arbitrary value from past errors. >> >> Signed-off-by: Aaron Campbell <aaron-rd7evPjynkNeoWH0uzbU5w@public.gmane.org> >> --- >> lib/librte_eal/linuxapp/eal/eal.c | 1 + >> 1 file changed, 1 insertion(+) >> >> 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; >> >> + errno = 0; >> addr = strtoull(arg, &end, 16); >> >> /* check for errors */ >> -- >> 1.8.3.2 > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-19 15:50 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-06-19 15:42 [PATCH] eal: clear errno before calling strtoull() to parse base_virtaddr Aaron Campbell [not found] ` <1403192557-10905-1-git-send-email-aaron-rd7evPjynkNeoWH0uzbU5w@public.gmane.org> 2014-06-19 15:46 ` Burakov, Anatoly [not found] ` <C6ECDF3AB251BE4894318F4E451236976CC9D71C-kPTMFJFq+rF9qrmMLTLiibfspsVTdybXVpNB7YpNyf8@public.gmane.org> 2014-06-19 15:50 ` Aaron Campbell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).