]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/gc: Make more robust in multithreaded applications.
authorBruno Haible <bruno@clisp.org>
Wed, 27 May 2020 17:38:36 +0000 (19:38 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 28 May 2020 19:39:50 +0000 (21:39 +0200)
* lib/gc-gnulib.c (randomize): Pass an O_CLOEXEC flag to open().
* modules/crypto/gc (Depends-on): Add 'open'.

ChangeLog
lib/gc-gnulib.c
modules/crypto/gc

index 744ab9f0e2d17e849b37e227afc3408690a84710..7c6e1939466f08db58a148c9e6c003ea291469d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-28  Bruno Haible  <bruno@clisp.org>
+
+       crypto/gc: Make more robust in multithreaded applications.
+       * lib/gc-gnulib.c (randomize): Pass an O_CLOEXEC flag to open().
+       * modules/crypto/gc (Depends-on): Add 'open'.
+
 2020-05-28  Bruno Haible  <bruno@clisp.org>
 
        copy-file: Make more robust in multithreaded applications.
index bb62ab150275d2125aada15299289b7964b065ae..8e9b88f075793f41b7b5a328b9299ece89221257 100644 (file)
@@ -167,7 +167,7 @@ randomize (int level, char *data, size_t datalen)
   if (strcmp (device, "no") == 0)
     return GC_RANDOM_ERROR;
 
-  fd = open (device, O_RDONLY);
+  fd = open (device, O_RDONLY | O_CLOEXEC);
   if (fd < 0)
     return GC_RANDOM_ERROR;
 
index f9f925387a6df6a678015220e6e899f0b98202c8..46ccde1334cadd51422d73aa5e8e6edd7d288af7 100644 (file)
@@ -10,6 +10,7 @@ m4/libgcrypt.m4
 
 Depends-on:
 havelib
+open
 
 configure.ac:
 gl_GC