lkml.org 
[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH 1/2] copy_process: fix CLONE_PARENT && ->exit_signal interaction
Date
As I think I said before, I don't really know what the actual use case is
for CLONE_PARENT without CLONE_THREAD. So it's easy to approve changing
its behavior, but I do vaguely worry about who expected what behavior before.

Just for readability, I would prefer that you just change the first line
above that sets p->exit_signal initially. i.e. (but with some comments):

diff --git a/kernel/fork.c b/kernel/fork.c
index a66fbde..f56793b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1184,7 +1184,10 @@ static struct task_struct *copy_process(unsigned long clone_flags,
p->parent_exec_id = p->self_exec_id;

/* ok, now we should be set up.. */
- p->exit_signal = (clone_flags & CLONE_THREAD) ? -1 : (clone_flags & CSIGNAL);
+ p->exit_signal = ((clone_flags & CLONE_THREAD) ? -1 :
+ (clone_flags & CLONE_PARENT) ?
+ current->group_leader->exit_signal :
+ (clone_flags & CSIGNAL));
p->pdeath_signal = 0;
p->exit_state = 0;


Thanks,
Roland


\
 
 \ /
  Last update: 2009-02-25 20:49    [W:0.074 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site