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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-01-24 20:40:55 +0300
committerCorinna Vinschen <corinna@vinschen.de>2006-01-24 20:40:55 +0300
commit4aac2d27099c81ef92f65af7b5446954a6a538ab (patch)
tree4b913e48fa807453ef43e7a6f32746589992ee59 /winsup
parent3acaaf543f9aa98b4b833d295b2d551a6621ae09 (diff)
* fhandler_process.cc (fhandler_process::fill_filebuf): Disable
stripping the .exe suffix from the link target in PROCESS_EXE and PROCESS_EXENAME case. * path.cc (realpath): Tack on .exe suffix if necessary.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/fhandler_process.cc6
-rw-r--r--winsup/cygwin/path.cc17
3 files changed, 28 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c808f28b9..764599513 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2006-01-24 Corinna Vinschen <corinna@vinschen.de>
+ * fhandler_process.cc (fhandler_process::fill_filebuf): Disable
+ stripping the .exe suffix from the link target in PROCESS_EXE and
+ PROCESS_EXENAME case.
+ * path.cc (realpath): Tack on .exe suffix if necessary.
+
+2006-01-24 Corinna Vinschen <corinna@vinschen.de>
+
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder
to determine remote file systems with reliable inode numbers. Add
longish comment.
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index cb7d9072d..648ced4ab 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -450,6 +450,11 @@ 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)
{
@@ -457,6 +462,7 @@ fhandler_process::fill_filebuf ()
if (strcasematch (s, ".exe"))
*s = 0;
}
+#endif
}
filesize = strlen (filebuf);
break;
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index fdba25400..a141c06fd 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3723,13 +3723,26 @@ realpath (const char *path, char *resolved)
if (!real_path.error && real_path.exists ())
{
+ /* Check for the suffix being tacked on. */
+ int tack_on = 0;
+ if (real_path.known_suffix)
+ {
+ char *c = strrchr (real_path.normalized_path, '.');
+ if (!c || !strcasematch (c, real_path.known_suffix))
+ tack_on = strlen (real_path.known_suffix);
+ }
+
if (!resolved)
{
- resolved = (char *) malloc (strlen (real_path.normalized_path) + 1);
+ resolved = (char *) malloc (strlen (real_path.normalized_path)
+ + tack_on + 1);
if (!resolved)
return NULL;
}
- return strcpy (resolved, real_path.normalized_path);
+ strcpy (resolved, real_path.normalized_path);
+ if (tack_on)
+ strcat (resolved, real_path.known_suffix);
+ return resolved;
}
/* FIXME: on error, we are supposed to put the name of the path