mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 12:58:07 +01:00
generalize libc linking using ctypes' find_library()
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user