diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-01-15 00:01:43 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-01-15 00:01:43 +0300 |
commit | 15996b6f08372a898c91a369051cce993a7b8f80 (patch) | |
tree | 41dcaa649513ea47f4797c8c50c2b7acb6a25e91 /winsup/cygwin/mmap.cc | |
parent | 857b65ddba5afd0ef5c385a520056515b653a3e9 (diff) |
* mmap.cc (fixup_mmaps_after_fork): Copy protection to child process.
Change ambiguous debug output.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r-- | winsup/cygwin/mmap.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 4b7329cb6..08da3b823 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -1006,21 +1006,29 @@ fixup_mmaps_after_fork (HANDLE parent) } else { - BOOL ret, ret2; + BOOL ret; + DWORD dummy_prot; + ret = ReadProcessMemory (parent, address, address, getpagesize (), NULL); - ret2 = VirtualProtectEx(parent, - address, getpagesize (), - old_prot, &old_prot); - if (!ret2) - system_printf ("WARNING: VirtualProtectEx to" + if (!VirtualProtectEx(parent, + address, getpagesize (), + old_prot, &dummy_prot)) + system_printf ("WARNING: VirtualProtectEx to " "return to previous state " "in parent failed for " "MAP_PRIVATE address %p, %E", rec->get_address ()); + if (!VirtualProtect (address, getpagesize (), + old_prot, &dummy_prot)) + system_printf ("WARNING: VirtualProtect to copy " + "protection to child failed for" + "MAP_PRIVATE address %p, %E", + rec->get_address ()); if (!ret) { - system_printf ("ReadProcessMemory FAILED for " + system_printf ("ReadProcessMemory (2nd try) " + "failed for " "MAP_PRIVATE address %p, %E", rec->get_address ()); return -1; |