patch-2.1.60 linux/fs/binfmt_elf.c

Next file: linux/fs/block_dev.c
Previous file: linux/fs/binfmt_aout.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.59/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
@@ -584,9 +584,12 @@
 		}
 	}
 
-	/* OK, This is the point of no return */
-	flush_old_exec(bprm);
+	/* Flush all traces of the currently running executable */
+	retval = flush_old_exec(bprm);
+	if (retval)
+		return retval;
 
+	/* OK, This is the point of no return */
 	current->mm->end_data = 0;
 	current->mm->end_code = 0;
 	current->mm->start_mmap = ELF_START_MMAP;
@@ -821,7 +824,8 @@
 		file->f_pos = 0;
 
 	set_fs(KERNEL_DS);
-	error = file->f_op->read(inode, file, (char *) &elf_ex, sizeof(elf_ex));
+	error = file->f_op->read(file, (char *) &elf_ex,
+				 sizeof(elf_ex), &file->f_pos);
 	set_fs(USER_DS);
 	if (error != sizeof(elf_ex))
 		return -ENOEXEC;
@@ -918,7 +922,7 @@
  */
 static int dump_write(struct file *file, const void *addr, int nr)
 {
-	return file->f_op->write(file->f_dentry->d_inode, file, addr, nr) == nr;
+	return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
 }
 
 static int dump_seek(struct file *file, off_t off)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov