diff --git a/src/client/cockpit-client b/src/client/cockpit-client index e9260333ed17..55a2411049b2 100755 --- a/src/client/cockpit-client +++ b/src/client/cockpit-client @@ -47,11 +47,11 @@ except (ValueError, ImportError): libexecdir = os.path.realpath(__file__ + '/..') -libc6 = ctypes.cdll.LoadLibrary('libc.so.6') +sys_prctl = ctypes.CDLL(None).prctl def prctl(*args): - if libc6.prctl(*args) != 0: + if sys_prctl(*args) != 0: raise Exception('prctl() failed') diff --git a/src/cockpit/transports.py b/src/cockpit/transports.py index 913603544ac0..4fcf76121ee9 100644 --- a/src/cockpit/transports.py +++ b/src/cockpit/transports.py @@ -33,11 +33,11 @@ from .jsonutil import JsonObject, get_int -libc6 = ctypes.cdll.LoadLibrary('libc.so.6') +sys_prctl = ctypes.CDLL(None).prctl def prctl(*args: int) -> None: - if libc6.prctl(*args) != 0: + if sys_prctl(*args) != 0: raise OSError('prctl() failed')