diff options
author | Christopher Faylor <me@cgf.cx> | 2005-12-26 19:34:59 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-12-26 19:34:59 +0000 |
commit | a16b738dd53486a3a65a28519129ebd060a02db9 (patch) | |
tree | 997fdb3185d3f3e8e83524e53a7578bd63aef357 /winsup/cygwin/dcrt0.cc | |
parent | c675040a068e107e8628b8e29efd975b1162dc66 (diff) | |
download | cygnal-a16b738dd53486a3a65a28519129ebd060a02db9.tar.gz cygnal-a16b738dd53486a3a65a28519129ebd060a02db9.tar.bz2 cygnal-a16b738dd53486a3a65a28519129ebd060a02db9.zip |
* dcrt0.cc (__api_fatal): Simplify to just use strace mechamisms.
(do_exit): Move minimal_printf...
* pinfo.cc (pinfo::exit): ...into here.
* strace.cc (strace::vprntf): Guarantee output to the console when
system_printf/api_fatal.
* heap.cc (heap_init): Wait a second before issuing an error when
ERROR_INVALID_ADDRESS since this is probably due to a CTRL-C handler sneaking
in, using the memory that we want to use for the heap, and, eventually exiting.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index fcff2c324..ff61d3e13 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -1132,7 +1132,6 @@ do_exit (int status) tty_terminate (); } - minimal_printf ("winpid %d, exit %d", GetCurrentProcessId (), n); myself.exit (n); } @@ -1171,24 +1170,10 @@ __api_fatal (const char *fmt, ...) va_list ap; va_start (ap, fmt); - int n = __small_sprintf (buf, "%P (%u): *** ", cygwin_pid (GetCurrentProcessId ())); + int n = __small_sprintf (buf, "%P: *** fatal error - ", cygwin_pid (GetCurrentProcessId ())); __small_vsprintf (buf + n, fmt, ap); va_end (ap); - strcat (buf, "\n"); - int len = strlen (buf); - DWORD done; - WriteFile (GetStdHandle (STD_ERROR_HANDLE), buf, len, &done, 0); - - /* Make sure that the message shows up on the screen, too, since this is - a serious error. */ - if (GetFileType (GetStdHandle (STD_ERROR_HANDLE)) != FILE_TYPE_CHAR) - { - HANDLE h = CreateFile ("CONOUT$", GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_WRITE | FILE_SHARE_WRITE, - &sec_none, OPEN_EXISTING, 0, 0); - if (h != INVALID_HANDLE_VALUE) - WriteFile (h, buf, len, &done, 0); - } + strace.prntf (_STRACE_SYSTEM, NULL, "%s", buf); #ifdef DEBUGGING try_to_debug (); |