Re: [Grep-devel] avoiding new warnings

2017-05-22 Thread Jim Meyering
On Sun, May 21, 2017 at 1:10 PM, Paul Eggert wrote: > Jim Meyering wrote: >> >> two of the three instances it flagged in grep >> were odd enough that I feel they benefit from the added attention > > > Anybody reading those two instances of the code would already know what's > going on; it's pretty

Re: errno from open() ?

2017-05-22 Thread Bruno Haible
Tim Rühsen wrote: > > > on GNU/Linux open() on a directory returns -1 and sets errno to EISDIR. > > > > No, for example on my platform (Fedora 25 x86-64), 'strace cat .' > > outputs the line 'open(".", O_RDONLY) = 3'. > > Same here on Debian unstable. > What you want to say is, that it depends on

Re: [PATCH] Remove repeated words

2017-05-22 Thread Bruno Haible
> Signed-off-by: Bjarni Ingi Gislason Thanks, I applied this in your name, except for the part that applies to texinfo.tex, because it is maintained upstream (-> Karl). > diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex > index 8204f3e3a..3c908e20c 100644 > --- a/build-aux/texinfo.tex

Re: errno from open() ?

2017-05-22 Thread Tim Rühsen
On Montag, 22. Mai 2017 08:00:14 CEST Paul Eggert wrote: > On 05/22/2017 03:58 AM, Tim Rühsen wrote: > > on GNU/Linux open() on a directory returns -1 and sets errno to EISDIR. > > No, for example on my platform (Fedora 25 x86-64), 'strace cat .' > outputs the line 'open(".", O_RDONLY) = 3'. Same

[PATCH] Remove repeated words

2017-05-22 Thread Bjarni Ingi Gislason
Signed-off-by: Bjarni Ingi Gislason --- ChangeLog | 16 build-aux/texinfo.tex | 2 +- lib/fd-hook.c | 2 +- lib/fd-hook.h | 2 +- lib/savewd.c | 2 +- lib/uninorm/decomposition-ta

Re: [PATCH] fallthrough: update for GCC 7/8

2017-05-22 Thread Jim Meyering
On Mon, May 22, 2017 at 4:50 AM, Pádraig Brady wrote: > On 22/05/17 07:07, Bernhard Voelker wrote: >> On 05/20/2017 02:12 AM, Jim Meyering wrote: >>> * lib/quotearg.c (FALLTHROUGH): New macro. >>> Use it whenever one switch case falls through into the next, >>> replacing "/* Fall through */" comme

Re: errno from open() ?

2017-05-22 Thread Paul Eggert
On 05/22/2017 03:58 AM, Tim Rühsen wrote: on GNU/Linux open() on a directory returns -1 and sets errno to EISDIR. No, for example on my platform (Fedora 25 x86-64), 'strace cat .' outputs the line 'open(".", O_RDONLY) = 3'.

Re: errno from open() ?

2017-05-22 Thread Tim Rühsen
On 05/22/2017 02:04 PM, Gisle Vanem wrote: > Tim Rühsen wrote: > >> Built on MinGW / Win32 the same open sets errno to EACCES. >> >> >> We currently use a work-around like >> +int rc = open(pathname, flags, mode); >> +#ifdef _WIN32 >> +if (rc < 0 && errno == EACCES) { >> +DWORD att

Re: errno from open() ?

2017-05-22 Thread Gisle Vanem
Tim Rühsen wrote: Built on MinGW / Win32 the same open sets errno to EACCES. We currently use a work-around like + int rc = open(pathname, flags, mode); +#ifdef _WIN32 + if (rc < 0 && errno == EACCES) { + DWORD attrs = GetFileAttributes(pathname); + if (

Re: [PATCH] fallthrough: update for GCC 7/8

2017-05-22 Thread Pádraig Brady
On 22/05/17 07:07, Bernhard Voelker wrote: > On 05/20/2017 02:12 AM, Jim Meyering wrote: >> * lib/quotearg.c (FALLTHROUGH): New macro. >> Use it whenever one switch case falls through into the next, >> replacing "/* Fall through */" comments. This exposed one >> instance of an unwarranted "fall th

Re: errno from open() ?

2017-05-22 Thread Tim Rühsen
On 05/22/2017 12:58 PM, Tim Rühsen wrote: > Hi, > > on GNU/Linux open() on a directory returns -1 and sets errno to EISDIR. > > Built on MinGW / Win32 the same open sets errno to EACCES. > > > We currently use a work-around like > + int rc = open(pathname, flags, mode); > +#ifdef _WIN32 > +

errno from open() ?

2017-05-22 Thread Tim Rühsen
Hi, on GNU/Linux open() on a directory returns -1 and sets errno to EISDIR. Built on MinGW / Win32 the same open sets errno to EACCES. We currently use a work-around like + int rc = open(pathname, flags, mode); +#ifdef _WIN32 + if (rc < 0 && errno == EACCES) { + DWORD