* environ.cc (struct parse_thing): Add transparent_exe option.

* fhandler_disk_file.cc (fhandler_disk_file::link): Accomodate
	transparent_exe option.  Add .exe suffix for links to executable files,
	if transparent_exe is set.
	* fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe
	suffix if transparent_exe option is set.
	* path.cc (symlink_worker): Accomodate transparent_exe option.
	(realpath): Don't tack on .exe suffix if transparent_exe is set.
	* syscalls.cc (transparent_exe): New global variable.
	(unlink): Accomodate transparent_exe option.
	(open): Ditto.
	(link): Ditto.
	(rename): Ditto. Maybe add .exe suffix when renaming executable files.
	(pathconf): Accomodate transparent_exe option.
	* winsup.h: Declare transparent_exe.
This commit is contained in:
Corinna Vinschen
2006-02-05 18:18:02 +00:00
parent 0913522dbd
commit fbae2bf864
7 changed files with 108 additions and 37 deletions

View File

@ -451,19 +451,18 @@ fhandler_process::fill_filebuf ()
else
{
mount_table->conv_to_posix_path (p->progname, filebuf, 1);
#if 0
/* Temporarily disabled. The link will have a suffix so that
an open(2) call will succeed on /proc/$PID/exe now. This
might become unnecessary if open(2) handles the .exe suffix
at one point. */
int len = strlen (filebuf);
if (len > 4)
/* If transparent_exe isn't set, the link keeps its suffix so that
an open(2) call will succeed on /proc/$PID/exe. */
if (transparent_exe)
{
char *s = filebuf + len - 4;
if (strcasematch (s, ".exe"))
*s = 0;
int len = strlen (filebuf);
if (len > 4)
{
char *s = filebuf + len - 4;
if (strcasematch (s, ".exe"))
*s = 0;
}
}
#endif
}
filesize = strlen (filebuf);
break;