From 9867ecfdb3dca69f38e339878eb87faccb9c50f7 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 3 Sep 2001 02:13:05 +0000 Subject: * child_info.h: Modify magic number. * dcrt0.cc (_cygwin_testing): Define. (_dll_crt0): Set _cygwin_testing if CYGWIN_TESTING environment variable exists. Don't issue "conflicting versions" error if _cygwin_testing is true. * shared.cc (shared_name): Use _cygwin_testing global rather than testing the environment. * syscalls.cc (_write): Remove debugging info. --- winsup/cygwin/dcrt0.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/dcrt0.cc') diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index bdaa3129c..f4acc8d44 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -72,6 +72,8 @@ unsigned int signal_shift_subtract = 1; ResourceLocks _reslock NO_COPY; MTinterface _mtinterf NO_COPY; +bool NO_COPY _cygwin_testing; + extern "C" { void *export_malloc (unsigned int); @@ -872,15 +874,18 @@ dll_crt0_1 () extern "C" void __stdcall _dll_crt0 () { + char envbuf[8]; #ifdef DEBUGGING - char buf[80]; - if (GetEnvironmentVariable ("CYGWIN_SLEEP", buf, sizeof (buf))) + if (GetEnvironmentVariable ("CYGWIN_SLEEP", envbuf, sizeof (envbuf) - 1)) { - console_printf ("Sleeping %d, pid %u\n", atoi (buf), GetCurrentProcessId ()); - Sleep (atoi (buf)); + console_printf ("Sleeping %d, pid %u\n", atoi (envbuf), GetCurrentProcessId ()); + Sleep (atoi (envbuf)); } #endif + if (GetEnvironmentVariable ("CYGWIN_TESTING", envbuf, sizeof (envbuf) - 1)) + _cygwin_testing = 1; + char zeros[sizeof (fork_info->zero)] = {0}; #ifdef DEBUGGING strace.microseconds (); @@ -921,7 +926,9 @@ _dll_crt0 () break; } default: - if ((fork_info->type & PROC_MAGIC_MASK) == PROC_MAGIC_GENERIC) + if (_cygwin_testing) + fork_info = NULL; + else if ((fork_info->type & PROC_MAGIC_MASK) == PROC_MAGIC_GENERIC) api_fatal ("conflicting versions of cygwin1.dll detected. Use only the most recent version.\n"); break; } -- cgit v1.2.3