From dd709581d5750d11eaa8e96f64ff62f16b8f6201 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 21 Jun 2011 15:36:15 +0200 Subject: rename process --- module/lib/rename_process.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'module/lib') diff --git a/module/lib/rename_process.py b/module/lib/rename_process.py index 2aa270171..8d74387f3 100644 --- a/module/lib/rename_process.py +++ b/module/lib/rename_process.py @@ -1,21 +1,14 @@ import sys -import os.path - -def RenameProcess(new_name): +def renameProcess(new_name): """ Renames the process calling the function to the given name. """ if sys.platform != 'linux2': - print 'Unsupported platform' return False try: - import ctypes - is_64 = os.path.exists('/lib64/libc.so.6') - if is_64: - libc = ctypes.CDLL('/lib64/libc.so.6') - else: - libc = ctypes.CDLL('/lib/libc.so.6') + from ctypes import CDLL + libc = CDLL('libc.so.6') libc.prctl(15, new_name, 0, 0, 0) return True - except: - print "rename failed" + except Exception, e: + print "Rename process failed", e return False -- cgit v1.2.3