From 1af912ce3c719962b7c368a1813db1af0a032a02 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 30 Aug 2004 22:08:50 +0000 Subject: [PATCH] * fork.cc (fork_parent): Record child's pid when we're sure that it has been filled out by the child. * pinfo.cc (pinfo::init): Trivial change. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fork.cc | 3 +-- winsup/cygwin/pinfo.cc | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7dc1cf277..286f9a6a2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2004-08-30 Christopher Faylor + + * fork.cc (fork_parent): Record child's pid when we're sure that it has + been filled out by the child. + * pinfo.cc (pinfo::init): Trivial change. + 2004-08-29 Corinna Vinschen * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Allow to report diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 0103b0dd3..0d4241975 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -514,8 +514,6 @@ fork_parent (HANDLE& hParent, dll *&first_dll, int forked_pid; - forked_pid = forked->pid; - /* Initialize things that are done later in dll_crt0_1 that aren't done for the forkee. */ strcpy (forked->progname, myself->progname); @@ -552,6 +550,7 @@ fork_parent (HANDLE& hParent, dll *&first_dll, if (!sync_with_child (pi, subproc_ready, true, "waiting for longjmp")) goto cleanup; + forked_pid = forked->pid; /* CHILD IS STOPPED */ debug_printf ("child is alive (but stopped)"); diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 82ea74d32..4156ef022 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -170,7 +170,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h) } else if (!createit) { - h = OpenFileMappingA (access, FALSE, mapname); + h = OpenFileMapping (access, FALSE, mapname); created = 0; } else -- 2.43.5