patch-2.1.97 linux/arch/sparc64/kernel/binfmt_aout32.c
Next file: linux/arch/sparc64/kernel/central.c
Previous file: linux/arch/sparc64/kernel/Makefile
Back to the patch index
Back to the overall index
- Lines: 47
- Date:
Tue Apr 14 17:44:20 1998
- Orig file:
v2.1.96/linux/arch/sparc64/kernel/binfmt_aout32.c
- Orig date:
Mon Jan 12 15:15:44 1998
diff -u --recursive --new-file v2.1.96/linux/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c
@@ -20,6 +20,7 @@
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
+#include <linux/file.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/malloc.h>
@@ -257,7 +258,7 @@
unsigned long p = bprm->p;
unsigned long fd_offset;
unsigned long rlim;
-int retval;
+ int retval;
ex = *((struct exec *) bprm->buf); /* exec-header */
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
@@ -326,10 +327,10 @@
printk(KERN_NOTICE "executable not page aligned\n");
fd = open_dentry(bprm->dentry, O_RDONLY);
-
if (fd < 0)
return fd;
- file = current->files->fd[fd];
+ file = fcheck(fd);
+
if (!file->f_op || !file->f_op->mmap) {
sys_close(fd);
do_mmap(NULL, 0, ex.a_text+ex.a_data,
@@ -397,6 +398,7 @@
return retval;
}
+/* N.B. Move to .h file and use code in fs/binfmt_aout.c? */
static inline int
do_load_aout32_library(int fd)
{
@@ -409,7 +411,7 @@
unsigned int start_addr;
unsigned long error;
- file = current->files->fd[fd];
+ file = fcheck(fd);
if (!file || !file->f_op)
return -EACCES;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov