summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_aout.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
commitb9ba7aeb165cffecdffb60aec8c3fa8d590d9ca9 (patch)
tree42d07b0c7246ae2536a702e7c5de9e2732341116 /fs/binfmt_aout.c
parent7406b0a326f2d70ade2671c37d1beef62249db97 (diff)
Merge with 2.3.99-pre6.
Diffstat (limited to 'fs/binfmt_aout.c')
-rw-r--r--fs/binfmt_aout.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index f48a2492d..4abff232c 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -252,7 +252,6 @@ static unsigned long * create_aout_tables(char * p, struct linux_binprm * bprm)
static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
{
struct exec ex;
- int fd;
unsigned long error;
unsigned long fd_offset;
unsigned long rlim;
@@ -284,11 +283,14 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
return retval;
/* OK, This is the point of no return */
- current->personality = PER_LINUX;
-
-#if defined(__sparc__) && !defined(__sparc_v9__)
+#if !defined(__sparc__)
+ set_personality(PER_LINUX);
+#else
+ set_personality(PER_SUNOS);
+#if !defined(__sparc_v9__)
memcpy(&current->thread.core_exec, &ex, sizeof(struct exec));
#endif
+#endif
current->mm->end_code = ex.a_text +
(current->mm->start_code = N_TXTADDR(ex));
@@ -341,12 +343,6 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
error_time2 = jiffies;
}
- fd = get_unused_fd();
- if (fd < 0)
- return fd;
- get_file(bprm->file);
- fd_install(fd, bprm->file);
-
if ((fd_offset & ~PAGE_MASK) != 0 &&
(jiffies-error_time) > 5*HZ)
{
@@ -358,7 +354,6 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) {
loff_t pos = fd_offset;
- sys_close(fd);
do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);
bprm->file->f_op->read(bprm->file,(char *)N_TXTADDR(ex),
ex.a_text+ex.a_data, &pos);
@@ -374,7 +369,6 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
fd_offset);
if (error != N_TXTADDR(ex)) {
- sys_close(fd);
send_sig(SIGKILL, current, 0);
return error;
}
@@ -383,20 +377,13 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
fd_offset + ex.a_text);
- sys_close(fd);
if (error != N_DATADDR(ex)) {
send_sig(SIGKILL, current, 0);
return error;
}
}
beyond_if:
- put_exec_domain(current->exec_domain);
- if (current->binfmt && current->binfmt->module)
- __MOD_DEC_USE_COUNT(current->binfmt->module);
- current->exec_domain = lookup_exec_domain(current->personality);
- current->binfmt = &aout_format;
- if (current->binfmt && current->binfmt->module)
- __MOD_INC_USE_COUNT(current->binfmt->module);
+ set_binfmt(&aout_format);
set_brk(current->mm->start_brk, current->mm->brk);