* 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.
This commit is contained in:
		| @@ -1,3 +1,9 @@ | |||||||
|  | 2005-04-21  Christopher Faylor  <cgf@timesys.com> | ||||||
|  |  | ||||||
|  | 	* 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. | ||||||
|  |  | ||||||
| 2005-04-20  Christopher Faylor  <cgf@timesys.com> | 2005-04-20  Christopher Faylor  <cgf@timesys.com> | ||||||
|  |  | ||||||
| 	* sigproc.cc (proc_subproc): Fix handling of waiting for pids with zero | 	* sigproc.cc (proc_subproc): Fix handling of waiting for pids with zero | ||||||
|   | |||||||
| @@ -195,17 +195,12 @@ void | |||||||
| shared_info::initialize () | shared_info::initialize () | ||||||
| { | { | ||||||
|   DWORD sversion = (DWORD) InterlockedExchange ((LONG *) &version, SHARED_VERSION_MAGIC); |   DWORD sversion = (DWORD) InterlockedExchange ((LONG *) &version, SHARED_VERSION_MAGIC); | ||||||
|   if (!sversion) |   if (sversion) | ||||||
|     { |     { | ||||||
|       /* Initialize tty table.  */ |       if (sversion != SHARED_VERSION_MAGIC) | ||||||
|       tty.init (); |  | ||||||
|     } |  | ||||||
|   else |  | ||||||
| 	{ | 	{ | ||||||
|       if (version != SHARED_VERSION_MAGIC) |  | ||||||
| 	{ |  | ||||||
| 	  multiple_cygwin_problem ("system shared memory version", version, SHARED_VERSION_MAGIC); |  | ||||||
| 	  InterlockedExchange ((LONG *) &version, sversion); | 	  InterlockedExchange ((LONG *) &version, sversion); | ||||||
|  | 	  multiple_cygwin_problem ("system shared memory version", sversion, SHARED_VERSION_MAGIC); | ||||||
| 	} | 	} | ||||||
|       while (!cb) |       while (!cb) | ||||||
| 	low_priority_sleep (0);	// Should be hit only very very rarely | 	low_priority_sleep (0);	// Should be hit only very very rarely | ||||||
| @@ -214,7 +209,10 @@ shared_info::initialize () | |||||||
|   heap_init (); |   heap_init (); | ||||||
|  |  | ||||||
|   if (!sversion) |   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) |   if (cb != SHARED_INFO_CB) | ||||||
|     system_printf ("size of shared memory region changed from %u to %u", |     system_printf ("size of shared memory region changed from %u to %u", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user