diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-18 16:06:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-18 16:06:22 -0400 |
commit | c2a0f5943d8935766a42b2d0870aa4c645e3423d (patch) | |
tree | e3a0b1bd202725989d908cc4686dab4b1d9855d9 /fs | |
parent | c83d9945c05570ba6b8ec5460c99d1ab7c6e6671 (diff) |
Clean up subthread exec
Make sure we re-parent itimers, and use BUG_ON() instead of an explicit
conditional BUG().
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exec.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -649,6 +649,7 @@ static inline int de_thread(struct task_struct *tsk) | |||
649 | } | 649 | } |
650 | sig->group_exit_task = NULL; | 650 | sig->group_exit_task = NULL; |
651 | sig->notify_count = 0; | 651 | sig->notify_count = 0; |
652 | sig->real_timer.data = (unsigned long)current; | ||
652 | spin_unlock_irq(lock); | 653 | spin_unlock_irq(lock); |
653 | 654 | ||
654 | /* | 655 | /* |
@@ -675,10 +676,8 @@ static inline int de_thread(struct task_struct *tsk) | |||
675 | proc_dentry2 = proc_pid_unhash(leader); | 676 | proc_dentry2 = proc_pid_unhash(leader); |
676 | write_lock_irq(&tasklist_lock); | 677 | write_lock_irq(&tasklist_lock); |
677 | 678 | ||
678 | if (leader->tgid != current->tgid) | 679 | BUG_ON(leader->tgid != current->tgid); |
679 | BUG(); | 680 | BUG_ON(current->pid == current->tgid); |
680 | if (current->pid == current->tgid) | ||
681 | BUG(); | ||
682 | /* | 681 | /* |
683 | * An exec() starts a new thread group with the | 682 | * An exec() starts a new thread group with the |
684 | * TGID of the previous thread group. Rehash the | 683 | * TGID of the previous thread group. Rehash the |
@@ -726,8 +725,7 @@ static inline int de_thread(struct task_struct *tsk) | |||
726 | proc_pid_flush(proc_dentry1); | 725 | proc_pid_flush(proc_dentry1); |
727 | proc_pid_flush(proc_dentry2); | 726 | proc_pid_flush(proc_dentry2); |
728 | 727 | ||
729 | if (exit_state != EXIT_ZOMBIE) | 728 | BUG_ON(exit_state != EXIT_ZOMBIE); |
730 | BUG(); | ||
731 | release_task(leader); | 729 | release_task(leader); |
732 | } | 730 | } |
733 | 731 | ||
@@ -772,10 +770,8 @@ no_thread_group: | |||
772 | kmem_cache_free(sighand_cachep, oldsighand); | 770 | kmem_cache_free(sighand_cachep, oldsighand); |
773 | } | 771 | } |
774 | 772 | ||
775 | if (!thread_group_empty(current)) | 773 | BUG_ON(!thread_group_empty(current)); |
776 | BUG(); | 774 | BUG_ON(!thread_group_leader(current)); |
777 | if (!thread_group_leader(current)) | ||
778 | BUG(); | ||
779 | return 0; | 775 | return 0; |
780 | } | 776 | } |
781 | 777 | ||