1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 21:08:06 +01:00

generalize libc linking using ctypes' find_library()

This commit is contained in:
David Paleino
2011-08-07 22:09:49 +02:00
parent 340725e9a7
commit e10e1e9b48

View File

@@ -406,11 +406,8 @@ def RenameProcess(new_name):
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.util import find_library
libc = ctypes.CDLL(find_library('c'))
libc.prctl(15, new_name, 0, 0, 0)
return True
except: