diff options
author | Christopher Faylor <me@cgf.cx> | 2000-10-12 04:38:29 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-10-12 04:38:29 +0000 |
commit | ec300c997904f1db79cd5ca49f798ae08a3eedba (patch) | |
tree | f0573247cacbf2efd21dd594bf3838c036035d4c /winsup/cygwin/dcrt0.cc | |
parent | 8251f53ddda33e780b8043665e638a558e0ef719 (diff) | |
download | cygnal-ec300c997904f1db79cd5ca49f798ae08a3eedba.tar.gz cygnal-ec300c997904f1db79cd5ca49f798ae08a3eedba.tar.bz2 cygnal-ec300c997904f1db79cd5ca49f798ae08a3eedba.zip |
* errno.cc (seterrno_from_win_error): Fix debugging output.
* fhandler.cc (fhandler_base::fstat): Move to inline method in fhandler.h.
(fhandler_base::set_io_handle): Ditto.
* fhandler.h (fhandler_base): Make some methods inline.
* fhandler_console.cc (fhandler_console::write_normal): Make buffer larger.
* sigproc.h (sigframe::sigframe): Actually use set ebp parameter correctly.
* spawn.cc (spawn_guts): Set dwProcessId when exec'ing. Just exit immediately
after reparenting.
* syscalls.cc: Sprinkle sigframe stuff throughout.
* wait.cc (wait4): Set signal frame here.
* dcrt0.cc (__api_fatal): Don't rely on small_printf to display errors. Always
display problems to the console, if possible.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 57d38445e..05f5a8d48 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -1042,6 +1042,7 @@ do_exit (int status) if (tp->getsid () == myself->sid) kill (-tp->getpgid (), SIGHUP); } + tty_terminate (); cleanup_pinfo = TRUE; } @@ -1085,7 +1086,21 @@ __api_fatal (const char *fmt, ...) va_start (ap, fmt); __small_vsprintf (buf, fmt, ap); va_end (ap); - small_printf ("%s\n", buf); + strcat (buf, "\n"); + int len = strlen (buf); + DWORD done; + (void) 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 = CreateFileA ("CONOUT$", GENERIC_READ|GENERIC_WRITE, + FILE_SHARE_WRITE | FILE_SHARE_WRITE, &sec_none, + OPEN_EXISTING, 0, 0); + if (h) + (void) WriteFile (h, buf, len, &done, 0); + } /* We are going down without mercy. Make sure we reset our process_state. */ @@ -1159,7 +1174,6 @@ LoadDLLinitfunc (user32) while (InterlockedIncrement (&here)) { InterlockedDecrement (&here); -small_printf ("Multiple tries to read user32.dll\n"); Sleep (0); } @@ -1182,7 +1196,6 @@ LoadDLLinitfunc (advapi32) while (InterlockedIncrement (&here)) { InterlockedDecrement (&here); -small_printf ("Multiple tries to read advapi32.dll\n"); Sleep (0); } |