mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-02-13 02:42:18 +02:00
tests: d_type-check: don't hardcode the C library name
* tests/d_type-check: The hardcoded name doesn't hold true for all Linux/glibc platforms, let alone Linux/non-glibc. Use ctypes.util.find_library() instead to search for the library.
This commit is contained in:
committed by
Pádraig Brady
parent
f1466d180b
commit
193560790c
@@ -5,7 +5,7 @@ import sys
|
||||
|
||||
fail = 1
|
||||
try:
|
||||
import ctypes
|
||||
import ctypes.util
|
||||
|
||||
(DT_UNKNOWN, DT_DIR,) = (0, 4,)
|
||||
|
||||
@@ -19,8 +19,7 @@ try:
|
||||
|
||||
direntp = ctypes.POINTER(dirent)
|
||||
|
||||
# FIXME: find a way to avoid hard-coding libc's so-name.
|
||||
libc = ctypes.cdll.LoadLibrary("libc.so.6")
|
||||
libc = ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True)
|
||||
libc.readdir.restype = direntp
|
||||
|
||||
dirp = libc.opendir(".")
|
||||
|
||||
Reference in New Issue
Block a user