summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/shared.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-04-21 23:53:49 +0000
committerChristopher Faylor <me@cgf.cx>2005-04-21 23:53:49 +0000
commitb13aa0048929834caaba6aba47e70125bc436e31 (patch)
tree2a857f2c93c14e5e68e6e7b1e4f19c73da1b9fb3 /winsup/cygwin/shared.cc
parent6794d799144dd2aa1faa5094358388944abce5ac (diff)
downloadcygnal-b13aa0048929834caaba6aba47e70125bc436e31.tar.gz
cygnal-b13aa0048929834caaba6aba47e70125bc436e31.tar.bz2
cygnal-b13aa0048929834caaba6aba47e70125bc436e31.zip
* shared.cc (shared_info::initialize): Test previous version of shared memory
magic rather than current version when determining if there has been a shared memory mismatch.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r--winsup/cygwin/shared.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index 3d6fddb74..48caefff0 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -195,17 +195,12 @@ void
shared_info::initialize ()
{
DWORD sversion = (DWORD) InterlockedExchange ((LONG *) &version, SHARED_VERSION_MAGIC);
- if (!sversion)
- {
- /* Initialize tty table. */
- tty.init ();
- }
- else
+ if (sversion)
{
- if (version != SHARED_VERSION_MAGIC)
+ if (sversion != SHARED_VERSION_MAGIC)
{
- multiple_cygwin_problem ("system shared memory version", version, SHARED_VERSION_MAGIC);
InterlockedExchange ((LONG *) &version, sversion);
+ multiple_cygwin_problem ("system shared memory version", sversion, SHARED_VERSION_MAGIC);
}
while (!cb)
low_priority_sleep (0); // Should be hit only very very rarely
@@ -214,7 +209,10 @@ shared_info::initialize ()
heap_init ();
if (!sversion)
- cb = sizeof (*this); // Do last, after all shared memory initializion
+ {
+ tty.init (); /* Initialize tty table. */
+ cb = sizeof (*this); /* Do last, after all shared memory initialization */
+ }
if (cb != SHARED_INFO_CB)
system_printf ("size of shared memory region changed from %u to %u",