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:
@@ -406,11 +406,8 @@ def RenameProcess(new_name):
|
|||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
import ctypes
|
import ctypes
|
||||||
is_64 = os.path.exists('/lib64/libc.so.6')
|
from ctypes.util import find_library
|
||||||
if is_64:
|
libc = ctypes.CDLL(find_library('c'))
|
||||||
libc = ctypes.CDLL('/lib64/libc.so.6')
|
|
||||||
else:
|
|
||||||
libc = ctypes.CDLL('/lib/libc.so.6')
|
|
||||||
libc.prctl(15, new_name, 0, 0, 0)
|
libc.prctl(15, new_name, 0, 0, 0)
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user