eal: fix plugin directory scan to be filesystem agnostic
[dpdk.git] / lib / librte_eal / common / eal_common_options.c
index a199093..29942ea 100644 (file)
@@ -191,12 +191,14 @@ eal_plugindir_init(const char *path)
        }
 
        while ((dent = readdir(d)) != NULL) {
-               if (dent->d_type != DT_REG && dent->d_type != DT_LNK)
-                       continue;
+               struct stat sb;
 
                snprintf(sopath, PATH_MAX-1, "%s/%s", path, dent->d_name);
                sopath[PATH_MAX-1] = 0;
 
+               if (!(stat(sopath, &sb) == 0 && S_ISREG(sb.st_mode)))
+                       continue;
+
                if (eal_plugin_add(sopath) == -1)
                        break;
        }