summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-10-23 03:30:23 +0100
committerPádraig Brady <P@draigBrady.com>2014-10-23 03:30:23 +0100
commit193560790ce99061cec50869f79bdcc787ed7783 (patch)
treeec830266768dd7bea8b6ee319207d260c14247ae /tests
parentf1466d180bee2daf682d49215247f00e400d5bae (diff)
downloadcoreutils-193560790ce99061cec50869f79bdcc787ed7783.tar.xz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/d_type-check5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/d_type-check b/tests/d_type-check
index 33c1fd6d0..ff1eb60b9 100644
--- a/tests/d_type-check
+++ b/tests/d_type-check
@@ -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(".")