diff options
author | Christopher Faylor <me@cgf.cx> | 2005-01-02 03:34:55 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-01-02 03:34:55 +0300 |
commit | d8c83adc04c2a7c13dd9a562189e049ea4c11a56 (patch) | |
tree | fe1df5aa84de764e64b45e97bc78c2f27ce49a74 /winsup/cygwin/shared.cc | |
parent | f8316b46dd876638049f1e33e37db9ce5e697ef4 (diff) |
* shared.cc (open_shared): Don't attempt VirtualAlloc magic if first attempt to
map memory fails.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r-- | winsup/cygwin/shared.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index b276f92f9..0e7ae1baa 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -79,7 +79,7 @@ open_shared (const char *name, int n, HANDLE &shared_h, DWORD size, void *shared; void *addr; - if (!wincap.needs_memory_protection ()) + if (!wincap.needs_memory_protection () && offsets[0]) addr = NULL; else { @@ -116,12 +116,13 @@ open_shared (const char *name, int n, HANDLE &shared_h, DWORD size, if (wincap.is_winnt ()) system_printf ("relocating shared object %s(%d) from %p to %p on Windows NT", name, n, addr, shared); #endif + offsets[0] = NULL; } if (!shared) api_fatal ("MapViewOfFileEx '%s'(%p), %E. Terminating.", name, shared_h); - if (m == SH_CYGWIN_SHARED && wincap.needs_memory_protection ()) + if (m == SH_CYGWIN_SHARED && offsets[0] && wincap.needs_memory_protection ()) { unsigned delta = (char *) shared - offsets[0]; offsets[0] = (char *) shared; |