summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorDave Olien <oliendm@us.ibm.com>2002-04-23 09:43:48 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-04-23 09:43:48 -0700
commitd5cedb89829c44f6f3e7a94e2cec6e75c49e8db1 (patch)
treefcb3df652ec22d37f93e87bf0c0464c6d591f7a1 /kernel/fork.c
parent40bbbd47e1975820232deacb25cc5d06debcf807 (diff)
[PATCH] 2.5.9 SEM_UNDO patch
As we discussed some time ago, here is a patch for the SEM_UNDO change that can be applied to linux-2.5.9.
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 380c1bafe75c..30800ff95c0a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -34,6 +34,9 @@
static kmem_cache_t *task_struct_cachep;
+extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
+extern void exit_semundo(struct task_struct *tsk);
+
/* The idle threads do not count.. */
int nr_threads;
@@ -710,8 +713,10 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start,
retval = -ENOMEM;
/* copy all the process information */
- if (copy_files(clone_flags, p))
+ if (copy_semundo(clone_flags, p))
goto bad_fork_cleanup;
+ if (copy_files(clone_flags, p))
+ goto bad_fork_cleanup_semundo;
if (copy_fs(clone_flags, p))
goto bad_fork_cleanup_files;
if (copy_sighand(clone_flags, p))
@@ -723,7 +728,6 @@ int do_fork(unsigned long clone_flags, unsigned long stack_start,
retval = copy_thread(0, clone_flags, stack_start, stack_size, p, regs);
if (retval)
goto bad_fork_cleanup_namespace;
- p->semundo = NULL;
/* Our parent execution domain becomes current domain
These must match for thread signalling to apply */
@@ -815,6 +819,8 @@ bad_fork_cleanup_fs:
exit_fs(p); /* blocking */
bad_fork_cleanup_files:
exit_files(p); /* blocking */
+bad_fork_cleanup_semundo:
+ exit_semundo(p);
bad_fork_cleanup:
put_exec_domain(p->thread_info->exec_domain);
if (p->binfmt && p->binfmt->module)