Skip to content

Commit

Permalink
Bug 1326496 - testing:mozbase: Use find_library to get libc filename.…
Browse files Browse the repository at this point in the history
… r=ahal

On architectures like alpha and ia64, the glibc does not use the
canonical ABI version number 6 but 6.1 and therefore the filename
of the C library is not libc.so.6 but libc.so.6.1. We're therefore
making the Python code more flexible and use find_library from
ctypes.util to determine the filename from the environment instead
of hard-coding it.

--HG--
extra : rebase_source : 64676648cec9975045a6dfeae1cfc9213226e242
  • Loading branch information
glaubitz committed Dec 30, 2016
1 parent a2cfbb6 commit c17700b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/mozbase/mozinfo/mozinfo/mozinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import re
import sys
from .string_version import StringVersion

from ctypes.util import find_library

# keep a copy of the os module since updating globals overrides this
_os = os
Expand Down Expand Up @@ -150,7 +150,7 @@ class OSVERSIONINFOEXW(ctypes.Structure):
import errno
PR_SET_SECCOMP = 22
SECCOMP_MODE_FILTER = 2
ctypes.CDLL("libc.so.6", use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0)
ctypes.CDLL(find_library("c"), use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0)
info['has_sandbox'] = ctypes.get_errno() == errno.EFAULT
else:
info['has_sandbox'] = True
Expand Down

0 comments on commit c17700b

Please sign in to comment.