]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
linux: slightly improve the old kernel detectio...
authorBrice Goglin <brice.goglin@inria.fr>
Fri, 14 Jun 2013 13:36:05 +0000 (13:36 +0000)
committerBrice Goglin <brice.goglin@inria.fr>
Fri, 14 Jun 2013 13:36:05 +0000 (13:36 +0000)
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

index de664181bca2b0fafc02dd7f4f1102f3c2664d45..b6cae703cec4a1d655c27d63c449101c66e817f5 100644 (file)
@@ -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: <device>/<class>:<name> */
     dir = opendir(devicepath);