fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / mips / kernel / irixelf.c
index 10d3644..37cad5d 100644 (file)
@@ -52,10 +52,6 @@ static struct linux_binfmt irix_format = {
        irix_core_dump, PAGE_SIZE
 };
 
-#ifndef elf_addr_t
-#define elf_addr_t unsigned long
-#endif
-
 #ifdef DEBUG
 /* Debugging routines. */
 static char *get_elf_p_type(Elf32_Word p_type)
@@ -999,8 +995,6 @@ static inline int maydump(struct vm_area_struct *vma)
        return 1;
 }
 
-#define roundup(x, y)  ((((x)+((y)-1))/(y))*(y))
-
 /* An ELF note in memory. */
 struct memelfnote
 {
@@ -1015,7 +1009,7 @@ static int notesize(struct memelfnote *en)
        int sz;
 
        sz = sizeof(struct elf_note);
-       sz += roundup(strlen(en->name), 4);
+       sz += roundup(strlen(en->name) + 1, 4);
        sz += roundup(en->datasz, 4);
 
        return sz;
@@ -1034,7 +1028,7 @@ static int writenote(struct memelfnote *men, struct file *file)
 {
        struct elf_note en;
 
-       en.n_namesz = strlen(men->name);
+       en.n_namesz = strlen(men->name) + 1;
        en.n_descsz = men->datasz;
        en.n_type = men->type;
 
@@ -1151,7 +1145,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
        psinfo.pr_pid = prstatus.pr_pid = current->pid;
        psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid;
        psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current);
-       psinfo.pr_sid = prstatus.pr_sid = current->signal->session;
+       psinfo.pr_sid = prstatus.pr_sid = process_session(current);
        if (current->pid == current->tgid) {
                /*
                 * This is the record for the group leader.  Add in the