From: Brendan Shanks bshanks@codeweavers.com
The default exit code is only used when a process is killed by the system or through a signal. These are exceptional cases where exit code 1 (killed by Task Manager) is more appropriate than the normal termination code of 0. --- server/process.c | 2 +- server/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/process.c b/server/process.c index a0d5ea64d97..cb7ed0c92ad 100644 --- a/server/process.c +++ b/server/process.c @@ -919,7 +919,7 @@ static void terminate_process( struct process *process, struct thread *skip, int restart: LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry ) { - if (exit_code) thread->exit_code = exit_code; + if (exit_code || thread->exit_code == 1) thread->exit_code = exit_code; if (thread == skip) continue; if (thread->state == TERMINATED) continue; kill_thread( thread, 1 ); diff --git a/server/thread.c b/server/thread.c index 3e35b27f694..2621d5af070 100644 --- a/server/thread.c +++ b/server/thread.c @@ -239,7 +239,7 @@ static inline void init_thread_structure( struct thread *thread ) thread->reply_fd = NULL; thread->wait_fd = NULL; thread->state = RUNNING; - thread->exit_code = 0; + thread->exit_code = 1; /* default to "killed by Task Manager" unless set otherwise */ thread->priority = 0; thread->suspend = 0; thread->dbg_hidden = 0;