Re: [PATCH] xstrtol: ensure errno is reset

2014-12-31 Thread Pádraig Brady
On 31/12/14 15:34, Paul Eggert wrote: > Pádraig Brady wrote: > >> strtol is documented to return ERANGE in certain cases, >> and the coreutils xdectoint wrapper uses and sets errno >> to give more accurate diagnostics. > > Sure, but this is xstrtol, not strtol. xstrtol returns its error indicato

Re: [PATCH] xstrtol: ensure errno is reset

2014-12-31 Thread Paul Eggert
Pádraig Brady wrote: strtol is documented to return ERANGE in certain cases, and the coreutils xdectoint wrapper uses and sets errno to give more accurate diagnostics. Sure, but this is xstrtol, not strtol. xstrtol returns its error indicator as a strtol_error value. It would be weird to in

Re: [PATCH] xstrtol: ensure errno is reset

2014-12-31 Thread Pádraig Brady
On 31/12/14 07:44, Paul Eggert wrote: > Pádraig Brady wrote: >> +2014-12-30 Pádraig Brady >> + >> +xstrtol: ensure errno is reset >> +Since commit 3bf75404, on 26-09-1998, errno may not have been reset. >> +Noticed with a spurious coreutils test failure on Darwin 14.0.0. > > Sorry, ca

Re: [PATCH] xstrtol: ensure errno is reset

2014-12-30 Thread Paul Eggert
Pádraig Brady wrote: +2014-12-30 Pádraig Brady + + xstrtol: ensure errno is reset + Since commit 3bf75404, on 26-09-1998, errno may not have been reset. + Noticed with a spurious coreutils test failure on Darwin 14.0.0. Sorry, can you explain more? First, why does xstrtol's

Re: [PATCH] xstrtol: ensure errno is reset

2014-12-30 Thread Jim Meyering
On Tue, Dec 30, 2014 at 3:42 PM, Pádraig Brady wrote: > Since commit 3bf75404, on 26-09-1998, errno may not have been reset. > Noticed with a spurious coreutils test failure on Darwin 14.0.0. > > * lib/xstrtol.c (__xstrtol): Always reset errno before returning. Cool (well, sort of :-), since it's

[PATCH] xstrtol: ensure errno is reset

2014-12-30 Thread Pádraig Brady
Since commit 3bf75404, on 26-09-1998, errno may not have been reset. Noticed with a spurious coreutils test failure on Darwin 14.0.0. * lib/xstrtol.c (__xstrtol): Always reset errno before returning. --- ChangeLog | 8 lib/xstrtol.c | 3 ++- 2 files changed, 10 insertions(+), 1 delet