Re: [PATCH ? 2/2] setpgid: should work for sub-threads

From: Oleg Nesterov
Date: Mon Dec 12 2005 - 07:02:49 EST


Oren Laadan wrote:
>
> -void __set_special_pids(pid_t session, pid_t pgrp)
> +void __set_special_pids(struct task_struct *tsk, pid_t session, pid_t pgrp)
> {
> - struct task_struct *curr = current;

Do we need to add the new paramater? I think we can just do:

- struct task_struct *curr = current;
+ struct task_struct *curr = current->group_leader;

and that's all. This function is called from daemonize() also,
but the kernel thread is a thread group leader always.

Oleg.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/