From e5be729554beb2ed1dce3bc77fea304aecfaf11d Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Sat, 17 Nov 2007 22:30:04 -0600 Subject: dont try to run personality() if we dont have a defined value. --- src/py-libs/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/py-libs') diff --git a/src/py-libs/util.py b/src/py-libs/util.py index 8553bac..1045d41 100644 --- a/src/py-libs/util.py +++ b/src/py-libs/util.py @@ -188,13 +188,13 @@ personality_defs['i386'] = 0x0008 # ... need to add ppc/ppc64... @traceLog(log) -def condPersonality(per): - if per is None: return +def condPersonality(per=None): + if personality_defs.get(per,None) is None: return import ctypes _libc = ctypes.cdll.LoadLibrary("libc.so.6") _libc.personality.argtypes = [ctypes.c_ulong] _libc.personality.restype = ctypes.c_int - _libc.personality(personality_defs.get(per, 0x00)) + _libc.personality(personality_defs[per]) # logger = # output = [1|0] -- cgit