patch-2.4.11-dontuse linux/kernel/exec_domain.c

Next file: linux/kernel/ksyms.c
Previous file: linux/ipc/sem.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.10/linux/kernel/exec_domain.c linux/kernel/exec_domain.c
@@ -219,13 +219,15 @@
 asmlinkage long
 sys_personality(u_long personality)
 {
-	if (personality == 0xffffffff)
-		goto ret;
-	set_personality(personality);
-	if (current->personality != personality)
-		return -EINVAL;
-ret:
-	return (current->personality);
+	u_long old = current->personality;;
+
+	if (personality != 0xffffffff) {
+		set_personality(personality);
+		if (current->personality != personality)
+			return -EINVAL;
+	}
+
+	return (long)old;
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)