dll_list: Track main executable and cygwin1.dll.

Even for the main executable and cygwin1.dll store the file name as full
NT path.  Create the child process using the main executable's file name
converted from the full NT path stored before.

	* dll_init.cc (dll_list::alloc): Search for DLL_SELF type entry
	with module name like for DLL_LINK, use full NT path to search
	for DLL_LOAD type only.  For DLL_SELF type do not indicate
	having a destructor to be called.
	(dll_list::find): Ignore DLL_SELF type entries.
	(dll_list::init): Ditto.  Call track_self method.
	(dll_list::track_self): New.
	(dll_list::load_after_fork): Call track_self method.
	* dll_init.h (enum dll_type): Add DLL_SELF, for the main
	executable and cygwin1.dll.
	(struct dll_list): Declare private method track_self.  Declare
	member variable main_executable.
	* fork.cc (frok::parent): Use ntname from dlls.main_executable
	to create child process, converted to short path using
	dll_list::buffered_shortname.
This commit is contained in:
Michael Haubenwallner
2016-12-07 11:58:26 +01:00
committed by Corinna Vinschen
parent 2678c4efe1
commit dac0b6826b
3 changed files with 36 additions and 9 deletions

View File

@ -40,6 +40,7 @@ struct per_module
typedef enum
{
DLL_NONE,
DLL_SELF, /* main-program.exe, cygwin1.dll */
DLL_LINK,
DLL_LOAD,
DLL_ANY
@ -75,6 +76,8 @@ struct dll
class dll_list
{
void track_self ();
dll *end;
dll *hold;
dll_type hold_type;
@ -94,6 +97,7 @@ public:
return nt_max_path_buffer;
}
dll *main_executable;
dll start;
int loaded_dlls;
int reload_on_fork;