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

ChangeLog
lib/javacomp.c
modules/javacomp

index 35518ae62b72516e98e8f871d2d953309b9d00ba..906adffe0f1850d5dbeb370e4e9059e29e3b6024 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-05-28  Bruno Haible  <bruno@clisp.org>
+
+       javacomp: Make more robust in multithreaded applications.
+       * lib/javacomp.c (get_classfile_version): Pass an O_CLOEXEC flag to
+       open().
+       * modules/javacomp (Depends-on): Add 'open'.
+
 2020-05-28  Bruno Haible  <bruno@clisp.org>
 
        getprogname: Make more robust in multithreaded applications.
index ac5619637cca1130e178fb71294dc2bb250d20d0..4717a5fd7d76dadcf1db9935ba04666eb5b6a9e9 100644 (file)
@@ -597,7 +597,7 @@ get_classfile_version (const char *compiled_file_name)
   int fd;
 
   /* Open the class file.  */
-  fd = open (compiled_file_name, O_RDONLY | O_BINARY, 0);
+  fd = open (compiled_file_name, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
   if (fd >= 0)
     {
       /* Read its first 8 bytes.  */
index fccdaac98e348ba1ef3c5c9e8d4b424b12d27f04..055279771fde7bb817a783311860dd1093bfbbce 100644 (file)
@@ -16,6 +16,7 @@ classpath
 xsetenv
 sh-quote
 binary-io
+open
 safe-read
 xalloc
 xmalloca