Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>2017-01-12 12:03:52 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-02-03 13:17:56 +0300
commit98899c68a23fdc8f1e8f657272d870be4bbaea6e (patch)
tree3c3f826bc6530fa6f6a4c2cf9de5459ee67430aa
parent700a2d260485039815f01efa11d356069d32e572 (diff)
forkables: use dynloaded dll's IndexNumber as dirname
-rw-r--r--winsup/cygwin/forkable.cc33
1 files changed, 8 insertions, 25 deletions
diff --git a/winsup/cygwin/forkable.cc b/winsup/cygwin/forkable.cc
index da45643ae..c569b0f70 100644
--- a/winsup/cygwin/forkable.cc
+++ b/winsup/cygwin/forkable.cc
@@ -409,34 +409,17 @@ dll::nominate_forkable (PCWCHAR dirx_name)
if (!*forkable_ntname)
return; /* denominate */
- if (type < DLL_LOAD)
- wcpcpy (next, modname);
- else
+ if (type == DLL_LOAD)
{
- /* Avoid lots of extra directories for loaded dll's:
- * mangle full path into one single directory name,
- * just keep original filename intact. The original
- * filename is necessary to serve as linked
- * dependencies of dynamically loaded dlls. */
- PWCHAR lastpathsep = wcsrchr (ntname, L'\\');
- if (!lastpathsep)
- {
- forkable_ntname = NULL;
- return;
- }
- *lastpathsep = L'\0';
- HANDLE fh = dll_list::ntopenfile (ntname, NULL, FILE_DIRECTORY_FILE);
- *lastpathsep = L'\\';
-
- FILE_INTERNAL_INFORMATION fii = { 0 };
- if (fh != INVALID_HANDLE_VALUE)
- {
- dll_list::read_fii (fh, &fii);
- NtClose (fh);
- }
+ /* Multiple dynamically loaded dlls can have identical basenames
+ * when loaded from different directories. But still the original
+ * basename may serve as linked dependency for another dynamically
+ * loaded dll. So we have to create a separate directory for the
+ * dynamically loaded dll - using the dll's IndexNumber as name. */
next += format_IndexNumber (next, -1, &fii.IndexNumber);
- wcpcpy (next, lastpathsep);
+ next = wcpcpy (next, L"\\");
}
+ wcpcpy (next, modname);
}
/* Create the nominated hardlink for one indivitual dll,