Commit 4a1629c4 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

ntdll: Avoid possible deadlock by using _exit() in NtTerminateProcess.

When threads are killed with SIGQUIT some locks can be in an undefined state, and it not safe to call exit handlers.
parent 453458f2
......@@ -21,11 +21,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
......@@ -60,7 +65,7 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
self = !ret && reply->self;
}
SERVER_END_REQ;
if (self && handle) exit( exit_code );
if (self && handle) _exit( exit_code );
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment