patch-2.4.22 linux-2.4.22/arch/s390x/kernel/binfmt_elf32.c
Next file: linux-2.4.22/arch/s390x/kernel/debug.c
Previous file: linux-2.4.22/arch/s390x/kernel/Makefile
Back to the patch index
Back to the overall index
-  Lines: 15
-  Date:
2003-08-25 04:44:40.000000000 -0700
-  Orig file: 
linux-2.4.21/arch/s390x/kernel/binfmt_elf32.c
-  Orig date: 
2001-04-11 19:02:29.000000000 -0700
diff -urN linux-2.4.21/arch/s390x/kernel/binfmt_elf32.c linux-2.4.22/arch/s390x/kernel/binfmt_elf32.c
@@ -87,7 +87,13 @@
 #define ELF_PLATFORM (NULL)
 
 #ifdef __KERNEL__
-#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
+#define SET_PERSONALITY(ex, ibcs2)			\
+do {							\
+	if (ibcs2)                                      \
+		set_personality(PER_SVR4);              \
+	else if (current->personality != PER_LINUX32)   \
+		set_personality(PER_LINUX);             \
+} while (0)
 #endif 
 
 #include "linux32.h"
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)