Ensure temp file is closed before its directory is removed.
authorBruno Haible <bruno@clisp.org>
Fri, 6 Oct 2006 13:32:11 +0000 (13:32 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 6 Oct 2006 13:32:11 +0000 (13:32 +0000)
lib/ChangeLog
lib/javacomp.c

index 6e58ab995982658000cd3d9782c1393134008b5f..e740b5544ff4301c54a4e75a84119bab2d534b7d 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-06  Bruno Haible  <bruno@clisp.org>
+
+       * javacomp.c (write_temp_file): Use fopen_temp, fwriteerror_temp
+       instead of fopen, fwriteerror.
+
 2006-10-05  Bruno Haible  <bruno@clisp.org>
 
        * clean-temp.h (open_temp, fopen_temp, close_temp, fclose_temp,
index f3e8a1812b99c2ca7adc29589d2e46599b1339a0..ba0f437004e2ebaa8bc1dff58d1a0e1c82a838b9 100644 (file)
@@ -467,7 +467,7 @@ write_temp_file (struct temp_dir *tmpdir, const char *file_name,
   FILE *fp;
 
   register_temp_file (tmpdir, file_name);
-  fp = fopen (file_name, "w");
+  fp = fopen_temp (file_name, "w");
   if (fp == NULL)
     {
       error (0, errno, _("failed to create \"%s\""), file_name);
@@ -475,7 +475,7 @@ write_temp_file (struct temp_dir *tmpdir, const char *file_name,
       return true;
     }
   fputs (contents, fp);
-  if (fwriteerror (fp))
+  if (fwriteerror_temp (fp))
     {
       error (0, errno, _("error while writing \"%s\" file"), file_name);
       return true;