Commit 0a364629 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Fixed process exit code on FreeBSD.

parent 68f8d289
...@@ -660,7 +660,7 @@ void kill_process( struct process *process, struct thread *skip, int exit_code ) ...@@ -660,7 +660,7 @@ void kill_process( struct process *process, struct thread *skip, int exit_code )
{ {
struct thread *thread = LIST_ENTRY( ptr, struct thread, proc_entry ); struct thread *thread = LIST_ENTRY( ptr, struct thread, proc_entry );
thread->exit_code = exit_code; if (exit_code) thread->exit_code = exit_code;
if (thread != skip) kill_thread( thread, 1 ); if (thread != skip) kill_thread( thread, 1 );
} }
} }
......
...@@ -389,9 +389,12 @@ int receive_fd( struct process *process ) ...@@ -389,9 +389,12 @@ int receive_fd( struct process *process )
return 0; return 0;
} }
if (ret >= 0) if (!ret)
{
kill_process( process, NULL, 0 );
}
else if (ret > 0)
{ {
if (ret > 0)
fprintf( stderr, "Protocol error: process %p: partial recvmsg %d for fd\n", fprintf( stderr, "Protocol error: process %p: partial recvmsg %d for fd\n",
process, ret ); process, ret );
kill_process( process, NULL, 1 ); kill_process( process, NULL, 1 );
......
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