From fbae2bf8641db16778ddd4348b6cb7a1115d5cca Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 5 Feb 2006 18:18:02 +0000 Subject: * 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. --- winsup/cygwin/fhandler_process.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'winsup/cygwin/fhandler_process.cc') diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index cb0b80520..28fd28c39 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -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; -- cgit v1.2.3