Commit 51f7c9d1 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Close server socket before calling exit().

So if a native exit handler hangs the process eventually gets killed by server. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 672df33f
......@@ -1471,6 +1471,18 @@ static void init_teb64( TEB *teb )
}
/***********************************************************************
* process_exit_wrapper
*
* Close server socket and exit process normally.
*/
void process_exit_wrapper( int status )
{
close( fd_socket );
exit( status );
}
/***********************************************************************
* server_init_process
*
* Start the server and create the initial socket pair.
......
......@@ -329,7 +329,7 @@ static void exit_thread( int status )
void exit_process( int status )
{
pthread_sigmask( SIG_BLOCK, &server_block_set, NULL );
signal_exit_thread( get_unix_exit_code( status ), exit );
signal_exit_thread( get_unix_exit_code( status ), process_exit_wrapper );
}
......
......@@ -164,6 +164,7 @@ extern unsigned int server_queue_process_apc( HANDLE process, const apc_call_t *
apc_result_t *result ) DECLSPEC_HIDDEN;
extern int server_get_unix_fd( HANDLE handle, unsigned int wanted_access, int *unix_fd,
int *needs_close, enum server_fd_type *type, unsigned int *options ) DECLSPEC_HIDDEN;
extern void process_exit_wrapper( int status ) DECLSPEC_HIDDEN;
extern size_t server_init_process(void) DECLSPEC_HIDDEN;
extern void server_init_process_done(void) DECLSPEC_HIDDEN;
extern void server_init_thread( void *entry_point, BOOL *suspend ) DECLSPEC_HIDDEN;
......
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