From: Bruce Richardson Date: Thu, 19 Oct 2017 08:49:12 +0000 (+0100) Subject: eal: avoid error for non-existent default PMD path X-Git-Tag: spdx-start~1273 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=d6a4399cdfc9a2fbc247e1936b4ba7e23cc95db9 eal: avoid error for non-existent default PMD path If the default location for the PMD .so files does not exist, it should not be treated as a fatal error condition like an incorrect path on the command line. Therefore check that the path exists and is a directory before adding it to the list of paths to check for PMDs. Signed-off-by: Bruce Richardson --- diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index e40c049610..450f2664a0 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -278,12 +278,13 @@ int eal_plugins_init(void) { struct shared_driver *solib = NULL; + struct stat sb; - if (*default_solib_dir != '\0') + if (*default_solib_dir != '\0' && stat(solib->name, &sb) == 0 && + S_ISDIR(sb.st_mode)) eal_plugin_add(default_solib_dir); TAILQ_FOREACH(solib, &solib_list, next) { - struct stat sb; if (stat(solib->name, &sb) == 0 && S_ISDIR(sb.st_mode)) { if (eal_plugindir_init(solib->name) == -1) {