Skip to content

Commit

Permalink
src: Stop hardcoding libc soname
Browse files Browse the repository at this point in the history
ia64/alpha has SONAME "libc.so.6.1"

`None` works because Python is linked against libc, so the symbol is
already in our address space.

Fixes #21396
  • Loading branch information
martinpitt committed Dec 13, 2024
1 parent 3bf5f1d commit c55fd41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/client/cockpit-client
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down
4 changes: 2 additions & 2 deletions src/cockpit/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down

0 comments on commit c55fd41

Please sign in to comment.