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:
authorCorinna Vinschen <corinna@vinschen.de>2006-02-05 21:18:02 +0300
committerCorinna Vinschen <corinna@vinschen.de>2006-02-05 21:18:02 +0300
commitfbae2bf8641db16778ddd4348b6cb7a1115d5cca (patch)
tree0a084553b7593bacab3a50af33a1b073f83318aa /winsup/cygwin/fhandler_process.cc
parent0913522dbd42e068bc737e7a32d1a8015a1e7c84 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_process.cc')
-rw-r--r--winsup/cygwin/fhandler_process.cc21
1 files changed, 10 insertions, 11 deletions
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;