-- v3: Update file console.c
From: eric pouech epouech@codeweavers.com
- /server/console.c - /server/process.c --- server/console.c | 2 +- server/process.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/server/console.c b/server/console.c index c3e7bf57e92..3de1df14d65 100644 --- a/server/console.c +++ b/server/console.c @@ -672,7 +672,7 @@ static int propagate_console_signal_cb(struct process *process, void *user) { struct console_signal_info* csi = (struct console_signal_info*)user;
- if (process->console == csi->console && (!csi->group || process->group_id == csi->group)) + if (process->console == csi->console csi->group_id && (!csi->group || process->group_id == csi->group)) { /* find a suitable thread to signal */ struct thread *thread; diff --git a/server/process.c b/server/process.c index 82b4826cfd0..ab1b0a95740 100644 --- a/server/process.c +++ b/server/process.c @@ -908,6 +908,19 @@ struct process *get_process_from_handle( obj_handle_t handle, unsigned int acces access, &process_ops ); }
+/* when process group leader terminates, remove all references to that group */ +static void remove_all_processes_from_group( process_id_t group_id ) +{ + struct process *process; + + LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry ) + { + if (process->group_id == group_id) + process->group_id = 0; + } +} + + /* terminate a process with the given exit code */ static void terminate_process( struct process *process, struct thread *skip, int exit_code ) { @@ -925,6 +938,9 @@ restart: kill_thread( thread, 1 ); goto restart; } + if (process->id == process->group_id) + remove_all_processes_from_group( process->group_id ); + release_object( process ); }
From: eric pouech epouech@codeweavers.com
--- server/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/console.c b/server/console.c index 3de1df14d65..37dddccc7a9 100644 --- a/server/console.c +++ b/server/console.c @@ -672,7 +672,7 @@ static int propagate_console_signal_cb(struct process *process, void *user) { struct console_signal_info* csi = (struct console_signal_info*)user;
- if (process->console == csi->console csi->group_id && (!csi->group || process->group_id == csi->group)) + if (process->console == csi->console && csi->group_id && (!csi->group || process->group_id == csi->group)) { /* find a suitable thread to signal */ struct thread *thread;