From e9593c3daef033607273554067d79b2ef55082c1 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 14 Jun 2013 13:36:05 +0000 Subject: [PATCH] linux: slightly improve the old kernel detectio... linux: slightly improve the old kernel detection code (r5668) Don't abort the lookup entirely when it occurs. Try the deprecated case too, just in case. This commit was SVN r5670. The following SVN revision numbers were found above: r5668 --> 648b26a9d0ca38c5a1dea63d4410764f83c4a226 --- src/topology-linux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/topology-linux.c b/src/topology-linux.c index de664181..b6cae703 100644 --- a/src/topology-linux.c +++ b/src/topology-linux.c @@ -3557,7 +3557,7 @@ hwloc_linux_class_readdir(struct hwloc_topology *topology, struct hwloc_obj *pci */ err = lstat(path, &st); if (err < 0 || !S_ISDIR(st.st_mode)) - return 0; + goto trydeprecated; dir = opendir(path); if (dir) { @@ -3577,6 +3577,7 @@ hwloc_linux_class_readdir(struct hwloc_topology *topology, struct hwloc_obj *pci } } +trydeprecated: if (hwloc_linux_deprecated_classlinks_model != 0) { /* deprecated sysfs: /: */ dir = opendir(devicepath); -- 2.39.5