This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: remove temporary .so files on exit
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 16 Feb 2005 14:35:19 -0700
- Subject: Patch: FYI: remove temporary .so files on exit
- Reply-to: tromey at redhat dot com
I'm checking this in.
When a shared library is already mapped for use with one class loader,
and it is requested by another, we make a copy of it and use the copy.
This copy is a temporary file, and this patch changes libgcj to delete
the file on exit.
Tom
2005-02-16 Tom Tromey <tromey@redhat.com>
* gnu/gcj/runtime/SharedLibHelper.java (findHelper): Delete
copied file on exit.
Index: gnu/gcj/runtime/SharedLibHelper.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/runtime/SharedLibHelper.java,v
retrieving revision 1.3
diff -u -r1.3 SharedLibHelper.java
--- gnu/gcj/runtime/SharedLibHelper.java 16 Feb 2005 18:51:20 -0000 1.3
+++ gnu/gcj/runtime/SharedLibHelper.java 16 Feb 2005 19:40:41 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2003, 2004 Free Software Foundation
+/* Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -67,13 +67,15 @@
}
public static SharedLibHelper findHelper (ClassLoader loader, String libname,
- CodeSource source, boolean tryParents)
+ CodeSource source,
+ boolean tryParents)
{
return findHelper (loader, libname, source, null, tryParents);
}
public static SharedLibHelper findHelper (ClassLoader loader, String libname,
- CodeSource source, ProtectionDomain domain,
+ CodeSource source,
+ ProtectionDomain domain,
boolean tryParents)
{
synchronized (map)
@@ -118,6 +120,7 @@
".so", new File ("/tmp"));
File src = new File(libname);
copyFile (src, copy);
+ copy.deleteOnExit();
libname = copy.getPath();
}
catch (IOException e)