diff options
author | Christopher Faylor <me@cgf.cx> | 2000-07-26 20:13:27 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-07-26 20:13:27 +0000 |
commit | 866c04e9cfad4b5757f56b110fa55297456a06e5 (patch) | |
tree | e88486e774c7a2bfdbd8b061958d05d0f107f767 | |
parent | 0d4c5950ff6bf63e4567aec1413015417017a4a6 (diff) | |
download | newlib-866c04e9cfad4b5757f56b110fa55297456a06e5.zip newlib-866c04e9cfad4b5757f56b110fa55297456a06e5.tar.gz newlib-866c04e9cfad4b5757f56b110fa55297456a06e5.tar.bz2 |
* exceptions.cc (signal_exit): Renamed from "really+exit". Always sets
EXIT_SIGNAL bit and reorganizes exit value for backwards cygwin handling.
(handle_exceptions): Call signal_exit. Set "core dumped" bit.
(sig_handle): Call signal_exit. Set "core dumped" bit appropriately.
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 25 |
2 files changed, 15 insertions, 18 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 20f14e7..ad84a8e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +Wed Jul 26 16:05:04 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (signal_exit): Renamed from "really+exit". Always sets + EXIT_SIGNAL bit and reorganizes exit value for backwards cygwin + handling. + (handle_exceptions): Call signal_exit. Set "core dumped" bit. + (sig_handle): Call signal_exit. Set "core dumped" bit appropriately. + Wed Jul 26 20:44:00 2000 Corinna Vinschen <corinna@vinschen.de> * environ.cc (posify): Revert previous patch. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 4b067f7..b9c927e 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -27,7 +27,7 @@ extern DWORD __sigfirst, __siglast; }; static BOOL WINAPI ctrl_c_handler (DWORD); -static void really_exit (int); +static void signal_exit (int); static char windows_system_directory[1024]; static size_t windows_system_directory_length; @@ -518,7 +518,7 @@ handle_exceptions (EXCEPTION_RECORD *e, void *, CONTEXT *in, void *) stackdump (e, &c); } try_to_debug (); - really_exit (EXIT_SIGNAL | sig); + signal_exit (0x80 | sig); // Flag signal + core dump } sig_send (NULL, sig, (DWORD) ebp); // Signal myself @@ -869,17 +869,6 @@ extern "C" { static void sig_handle_tty_stop (int sig) { -#if 0 - HANDLE waitbuf[2]; - - /* Be sure that process's main thread isn't an owner of vital - mutex to prevent cygwin subsystem lockups */ - waitbuf[0] = pinfo_mutex; - waitbuf[1] = title_mutex; - WaitForMultipleObjects (2, waitbuf, TRUE, INFINITE); - ReleaseMutex (pinfo_mutex); - ReleaseMutex (title_mutex); -#endif myself->stopsig = sig; myself->process_state |= PID_STOPPED; /* See if we have a living parent. If so, send it a special signal. @@ -993,7 +982,7 @@ exit_sig: GetThreadContext (hMainThread, &c); stackdump (NULL, &c); try_to_debug (); - really_exit (EXIT_SIGNAL | sig); + sig |= 0x80; } sigproc_printf ("signal %d, about to call do_exit", sig); TerminateThread (hMainThread, 0); @@ -1001,20 +990,20 @@ exit_sig: use a resource lock when exiting. */ user_data->resourcelocks->Delete (); user_data->resourcelocks->Init (); - do_exit (EXIT_SIGNAL | (sig << 8)); + signal_exit (sig); /* Never returns */ } /* Cover function to `do_exit' to handle exiting even in presence of more - exceptions. We use to call exit, but a SIGSEGV shouldn't cause atexit + exceptions. We used to call exit, but a SIGSEGV shouldn't cause atexit routines to run. */ - static void -really_exit (int rc) +signal_exit (int rc) { /* If the exception handler gets a trap, we could recurse awhile. If this is non-zero, skip the cleaning up and exit NOW. */ + rc = EXIT_SIGNAL | (rc << 8); if (exit_already++) { /* We are going down - reset our process_state without locking. */ |