This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Close temporary files in claim_file_handler


When gold passes files to the plugin it is responsible for closing
them. The gcc plugin also creates temporary files when handling
archives. Those files are the plugin's responsibility, but they are
not currently being closed. The attached patch fixes this.

2009-10-30  Rafael Avila de Espindola  <espindola@google.com>

	PR41871
	* lto-plugin.c (claim_file_handler): Close files that we created.

Cheers,
-- 
Rafael Ãvila de EspÃndola
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 3a51441..c92ac06 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -635,6 +635,9 @@ claim_file_handler (const struct ld_plugin_input_file *file, int *claimed)
   if (elf)
     elf_end (elf);
 
+  if (file->offset != 0)
+    close (lto_file_fd);
+
   return LDPS_OK;
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]