summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 4e876c8d0..0766b40a7 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -393,8 +393,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
ProtectHandleINH (subproc_ready);
}
- init_child_info (chtype, &ciresrv, (mode == _P_OVERLAY) ? myself->pid : 1,
- subproc_ready);
+ init_child_info (chtype, &ciresrv, subproc_ready);
ciresrv.moreinfo = (cygheap_exec_info *) ccalloc (HEAP_1_EXEC, 1, sizeof (cygheap_exec_info));
ciresrv.moreinfo->old_title = NULL;
@@ -630,6 +629,10 @@ spawn_guts (const char * prog_arg, const char *const *argv,
flags |= DETACHED_PROCESS;
if (mode != _P_OVERLAY)
flags |= CREATE_SUSPENDED;
+#if 0 //someday
+ else
+ myself->dwProcessId = 0;
+#endif
/* Some file types (currently only sockets) need extra effort in the
parent after CreateProcess and before copying the datastructures
@@ -638,7 +641,6 @@ spawn_guts (const char * prog_arg, const char *const *argv,
if (cygheap->fdtab.need_fixup_before ())
flags |= CREATE_SUSPENDED;
-
const char *runpath = null_app_name ? NULL : (const char *) real_path;
syscall_printf ("null_app_name %d (%s, %.9500s)", null_app_name, runpath, one_line.buf);
@@ -649,6 +651,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
cygheap->fdtab.set_file_pointers_for_exec ();
cygheap->user.deimpersonate ();
+
/* When ruid != euid we create the new process under the current original
account and impersonate in child, this way maintaining the different
effective vs. real ids.
@@ -729,6 +732,10 @@ spawn_guts (const char * prog_arg, const char *const *argv,
{
__seterrno ();
syscall_printf ("CreateProcess failed, %E");
+#if 0 // someday
+ if (mode == _P_OVERLAY)
+ myself->dwProcessId = GetCurrentProcessId ();
+#endif
if (subproc_ready)
ForceCloseHandle (subproc_ready);
cygheap_setup_for_child_cleanup (newheap, &ciresrv, 0);