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>2013-08-23 13:29:25 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-08-23 13:29:25 +0400
commit10822894db3c3266edf4a2c5417c71bc6a324145 (patch)
tree35f77b1bb1935060a802ef67729e463d23ae412c /winsup/cygwin/spawn.cc
parent20b311fd8ef7028a4074c404b9f92a4ca35f4d8e (diff)
* path.h (enum path_types): Drop definition of PATH_64BITEXEC.
(path_conv::iscygexec32): Drop unused inline function. (path_conv::iscygexec64): Ditto. (path_conv::set_cygexec): Remove unnecessary setting of PATH_64BITEXEC. * spawn.cc (child_info_spawn::worker): Disable setting of STARTUPINFOW::lpReserved2 and STARTUPINFOW::cbReserved2 for non-Cygwin child processes. Explain why.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 74c5fa40c..bd0ec177f 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -554,8 +554,17 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
__stdout = in__stdout;
record_children ();
- si.lpReserved2 = (LPBYTE) this;
- si.cbReserved2 = sizeof (*this);
+ /* Don't propagate the child_info_spawn structure to the process if it
+ hasn't been recognized as a Cygwin executable. This also covers Cygwin
+ executables of a different target (32 vs. 64 bit). Native processes
+ usually still work, even if lpReserved2 contains garbage from their
+ point of view, but Cygwin processes of different bitsize will recognize
+ it as Cygwin info and get all excited about the differences. */
+ if (real_path.iscygexec ())
+ {
+ si.lpReserved2 = (LPBYTE) this;
+ si.cbReserved2 = sizeof (*this);
+ }
/* Depends on set call above.
Some file types might need extra effort in the parent after CreateProcess