Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-01-02 03:34:55 +0300
committerChristopher Faylor <me@cgf.cx>2005-01-02 03:34:55 +0300
commitd8c83adc04c2a7c13dd9a562189e049ea4c11a56 (patch)
treefe1df5aa84de764e64b45e97bc78c2f27ce49a74 /winsup/cygwin/shared.cc
parentf8316b46dd876638049f1e33e37db9ce5e697ef4 (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.cc5
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;