server: Fixed process exit code on FreeBSD.

This commit is contained in:
Alexandre Julliard 2006-03-27 12:14:24 +02:00
parent 68f8d28945
commit 0a3646292a
2 changed files with 8 additions and 5 deletions

View File

@ -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 );
} }
} }

View File

@ -389,11 +389,14 @@ int receive_fd( struct process *process )
return 0; return 0;
} }
if (ret >= 0) if (!ret)
{ {
if (ret > 0) kill_process( process, NULL, 0 );
fprintf( stderr, "Protocol error: process %p: partial recvmsg %d for fd\n", }
process, ret ); else if (ret > 0)
{
fprintf( stderr, "Protocol error: process %p: partial recvmsg %d for fd\n",
process, ret );
kill_process( process, NULL, 1 ); kill_process( process, NULL, 1 );
} }
else else