diff options
author | Christopher Faylor <me@cgf.cx> | 2001-09-03 06:13:05 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-09-03 06:13:05 +0400 |
commit | 9867ecfdb3dca69f38e339878eb87faccb9c50f7 (patch) | |
tree | fb2ff116de616f51103edd12ecfe1b303cddd9ba /winsup/cygwin/dcrt0.cc | |
parent | db8b09c3068ea748c279ddce8608c1143579b6e3 (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 17 |
1 files changed, 12 insertions, 5 deletions
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; } |