4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-28 20:15:24 +08:00

* fork.cc (fork_parent): Return the cygpid directly derived from the winpid.

This commit is contained in:
Christopher Faylor 2004-08-31 03:34:04 +00:00
parent 1af912ce3c
commit 72067ccafa
2 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2004-08-30 Pierre Humblet <pierre.humblet@ieee.org>
* fork.cc (fork_parent): Return the cygpid directly derived from the
winpid.
2004-08-30 Christopher Faylor <cgf@timesys.com> 2004-08-30 Christopher Faylor <cgf@timesys.com>
* fork.cc (fork_parent): Record child's pid when we're sure that it has * fork.cc (fork_parent): Record child's pid when we're sure that it has

View File

@ -500,10 +500,12 @@ fork_parent (HANDLE& hParent, dll *&first_dll,
} }
#ifdef DEBUGGING #ifdef DEBUGGING
pinfo forked ((ch.cygpid != 1 ? ch.cygpid : cygwin_pid (pi.dwProcessId)), 1); int forked_pid = ch.cygpid != 1 ? ch.cygpid : cygwin_pid (pi.dwProcessId);
#else #else
pinfo forked (cygwin_pid (pi.dwProcessId), 1); int forked_pid = cygwin_pid (pi.dwProcessId);
#endif #endif
pinfo forked (forked_pid, 1);
if (!forked) if (!forked)
{ {
syscall_printf ("pinfo failed"); syscall_printf ("pinfo failed");
@ -512,8 +514,6 @@ fork_parent (HANDLE& hParent, dll *&first_dll,
goto cleanup; goto cleanup;
} }
int forked_pid;
/* Initialize things that are done later in dll_crt0_1 that aren't done /* Initialize things that are done later in dll_crt0_1 that aren't done
for the forkee. */ for the forkee. */
strcpy (forked->progname, myself->progname); strcpy (forked->progname, myself->progname);
@ -550,7 +550,6 @@ fork_parent (HANDLE& hParent, dll *&first_dll,
if (!sync_with_child (pi, subproc_ready, true, "waiting for longjmp")) if (!sync_with_child (pi, subproc_ready, true, "waiting for longjmp"))
goto cleanup; goto cleanup;
forked_pid = forked->pid;
/* CHILD IS STOPPED */ /* CHILD IS STOPPED */
debug_printf ("child is alive (but stopped)"); debug_printf ("child is alive (but stopped)");