summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 988a195bcc93..9e12b35e3924 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1085,9 +1085,11 @@ struct task_struct *do_fork(unsigned long clone_flags,
ptrace_notify ((trace << 8) | SIGTRAP);
}
- if (clone_flags & CLONE_VFORK)
+ if (clone_flags & CLONE_VFORK) {
wait_for_completion(&vfork);
- else
+ if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE))
+ ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP);
+ } else
/*
* Let the child process run first, to avoid most of the
* COW overhead when the child exec()s afterwards.