]> err.no Git - linux-2.6/blobdiff - fs/exec.c
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / fs / exec.c
index a8394499926cd3a7ce87ada09875f6ca6fb1ea5e..3a4b35a14c0d4504b0b3b8598c9ffa0d50ad6b40 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -197,7 +197,8 @@ static int count(char __user * __user * argv, int max)
  * memory to free pages in kernel mem. These are in a format ready
  * to be put directly into the top of new user memory.
  */
-int copy_strings(int argc,char __user * __user * argv, struct linux_binprm *bprm)
+static int copy_strings(int argc, char __user * __user * argv,
+                       struct linux_binprm *bprm)
 {
        struct page *kmapped_page = NULL;
        char *kaddr = NULL;
@@ -648,6 +649,7 @@ static inline int de_thread(struct task_struct *tsk)
        }
        sig->group_exit_task = NULL;
        sig->notify_count = 0;
+       sig->real_timer.data = (unsigned long)current;
        spin_unlock_irq(lock);
 
        /*
@@ -674,10 +676,8 @@ static inline int de_thread(struct task_struct *tsk)
                proc_dentry2 = proc_pid_unhash(leader);
                write_lock_irq(&tasklist_lock);
 
-               if (leader->tgid != current->tgid)
-                       BUG();
-               if (current->pid == current->tgid)
-                       BUG();
+               BUG_ON(leader->tgid != current->tgid);
+               BUG_ON(current->pid == current->tgid);
                /*
                 * An exec() starts a new thread group with the
                 * TGID of the previous thread group. Rehash the
@@ -725,8 +725,7 @@ static inline int de_thread(struct task_struct *tsk)
                proc_pid_flush(proc_dentry1);
                proc_pid_flush(proc_dentry2);
 
-               if (exit_state != EXIT_ZOMBIE)
-                       BUG();
+               BUG_ON(exit_state != EXIT_ZOMBIE);
                release_task(leader);
         }
 
@@ -771,10 +770,8 @@ no_thread_group:
                        kmem_cache_free(sighand_cachep, oldsighand);
        }
 
-       if (!thread_group_empty(current))
-               BUG();
-       if (!thread_group_leader(current))
-               BUG();
+       BUG_ON(!thread_group_empty(current));
+       BUG_ON(!thread_group_leader(current));
        return 0;
 }
        
@@ -868,9 +865,11 @@ int flush_old_exec(struct linux_binprm * bprm)
        if (current->euid == current->uid && current->egid == current->gid)
                current->mm->dumpable = 1;
        name = bprm->filename;
+
+       /* Copies the binary name from after last slash */
        for (i=0; (ch = *(name++)) != '\0';) {
                if (ch == '/')
-                       i = 0;
+                       i = 0; /* overwrite what we wrote */
                else
                        if (i < (sizeof(tcomm) - 1))
                                tcomm[i++] = ch;