patch-2.1.60 linux/arch/sparc64/kernel/binfmt_aout32.c

Next file: linux/drivers/block/floppy.c
Previous file: linux/arch/sparc64/config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.59/linux/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c
@@ -256,6 +256,7 @@
 	unsigned long p = bprm->p;
 	unsigned long fd_offset;
 	unsigned long rlim;
+	int retval;
 
 	ex = *((struct exec *) bprm->buf);		/* exec-header */
 	if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
@@ -278,8 +279,12 @@
 	if (ex.a_data + ex.a_bss > rlim)
 		return -ENOMEM;
 
+	/* 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 */
-	flush_old_exec(bprm);
 	memcpy(&current->tss.core_exec, &ex, sizeof(struct exec));
 
 	current->mm->end_code = ex.a_text +

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