Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-28 Thread Daiki Ueno
Bruno Haible writes: >> Here are proposed patches for other modules. Does this look right? > > There were no objections. I pushed the changes. Thank you for this. I have rebased GnuTLS on top of it, but noticed a strange test failures on Windows CI, which involve reading binary files (OCSP resp

Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-28 Thread Daiki Ueno
Daiki Ueno writes: > Bruno Haible writes: > >>> Here are proposed patches for other modules. Does this look right? >> >> There were no objections. I pushed the changes. > > Thank you for this. I have rebased GnuTLS on top of it, but noticed a > strange test failures on Windows CI, which involve

Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-28 Thread Bruno Haible
Hi Daiki, Thank you for noticing this, and the rapid fix. > Sorry, attached an old patch; this would be simpler (and also supports > other platforms that need O_BINARY). > + ASSERT (fwrite (DATA, 1, sizeof(DATA)-1, f) == sizeof(DATA)-1); ... > + ASSERT (fread (buf, 1, sizeof(buf), f) == sizeof

Re: use O_CLOEXEC in more places

2020-05-28 Thread Bruno Haible
Paul Eggert wrote: > > How about module 'fts'? Should the directory fds that it allocates also be > > made O_CLOEXEC? > > Yes, I'd say so; I see little reason for a child process to continue an fts > scan. Done through this patch. In fact, you had already done most of the work on 2017-08-12. Br

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-28 Thread Bruno Haible
> Both has been fixed and pushed. Thank you for the review! Let me update the uses of the module 'read-file' in Gnulib. I think the next weekly CI run would have caught this. 2020-05-28 Bruno Haible Fix build errors due to read-file changes (regression from 2020-05-27). * li

Re: explicit_bzero-tests: pacify -Wmissing-declarations

2020-05-28 Thread Paul Eggert
On 5/25/20 12:28 AM, Bruno Haible wrote: > Is it possible to portably mark 'do_secret_stuff' as not-inline? We can use _GL_ATTRIBUTE_NOINLINE. That should be good enough for any GCC-compatible compiler. We don't need to worry much about the other compilers; most of them will work anyway, and if an

Re: explicit_bzero-tests: pacify -Wmissing-declarations

2020-05-28 Thread Bruno Haible
Paul Eggert wrote: > > Is it possible to portably mark 'do_secret_stuff' as not-inline? > > We can use _GL_ATTRIBUTE_NOINLINE. That should be good enough for any > GCC-compatible compiler. We don't need to worry much about the other > compilers; > most of them will work anyway, and if any don't w

Re: explicit_bzero-tests: pacify -Wmissing-declarations

2020-05-28 Thread Paul Eggert
On 5/28/20 3:24 PM, Bruno Haible wrote: > Agreed. Please go ahead. I'll deal with possible xlc/Sun cc/MSVC build > failures > then. OK, I installed the attached. >From ef7cc081f5c0d1b71f60f71d5e0f4a9ddf76bb28 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 28 May 2020 16:02:32 -0700 Subjec

Re: [PATCH] stat: remove _GL_WINDOWS_STAT_INODES == 2 support

2020-05-28 Thread Bruno Haible
Steve Lhomme wrote: > It may be outdated code, the value is never 2. The value is currently never 2, correct. But you can see from the patch that introduced this code [1] that the reason why it's not enabled is that it requires -D_WIN32_WINNT=_WIN32_WINNT_WIN8 or higher. Obviously at a moment when

Re: [PATCH] gettimeofday: do not use LoadLibrary when built for Windows Store apps

2020-05-28 Thread Bruno Haible
Hi, Steve Lhomme wrote: > LoadLibrary is forbidden in such apps (can only load DLLs from within the app > package). > The API entries are available to all apps linking with the Windows API as > found > here: > https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis Thanks for these infos.

Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-28 Thread Daiki Ueno
Bruno Haible writes: >> + ASSERT (fwrite (DATA, 1, sizeof(DATA)-1, f) == sizeof(DATA)-1); > ... >> + ASSERT (fread (buf, 1, sizeof(buf), f) == sizeof(DATA)-1); > > GNU coding style wants a space between 'sizeof' and the opening parenthesis. > Other than that, your patch is perfect. Thank you f

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-28 Thread Daiki Ueno
Bruno Haible writes: > Let me update the uses of the module 'read-file' in Gnulib. > I think the next weekly CI run would have caught this. Thank you; I completely missed those uses in Gnulib. On a different note, it was suggested to disable stdio buffering if RF_SENSITIVE is set. I am attachi

Re: [PATCH] gettimeofday: do not use LoadLibrary when built for Windows Store apps

2020-05-28 Thread Daiki Ueno
Hello, Bruno Haible writes: > diff --git a/lib/stat-w32.c b/lib/stat-w32.c > index b9163f5..02ad9ab 100644 > --- a/lib/stat-w32.c > +++ b/lib/stat-w32.c > @@ -40,18 +40,20 @@ > #include "pathmax.h" > #include "verify.h" > > +#if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA) > + I am totally unfamil

Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-28 Thread Bruno Haible
Daiki Ueno wrote: > Afterwards, I realized a > compilation error in the test code on FreeBSD, so I've added the > follow-up patch attached. Indeed, octal and hexadecimal escape sequences are not limited to 3 or 2 digits. ISO C 11 section 6.4.4.4 says: "The hexadecimal digits that follow the bac