eal: fix runtime directory cleanup in noshconf mode
authorAnatoly Burakov <anatoly.burakov@intel.com>
Thu, 20 Dec 2018 11:11:48 +0000 (11:11 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 20 Dec 2018 22:27:35 +0000 (23:27 +0100)
When using --no-shconf or --in-memory modes, there is no runtime
directory to be created, so there is no point in attempting to
clean it.

Fixes: 0a529578f162 ("eal: clean up unused files on initialization")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal.c

index 41ddb5a..20f790a 100644 (file)
@@ -901,8 +901,11 @@ rte_eal_init(int argc, char **argv)
         * whether we are primary or secondary process, but we cannot remove
         * primary process' files because secondary should be able to run even
         * if primary process is dead.
+        *
+        * In no_shconf mode, no runtime directory is created in the first
+        * place, so no cleanup needed.
         */
-       if (eal_clean_runtime_dir() < 0) {
+       if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
                rte_eal_init_alert("Cannot clear runtime directory\n");
                return -1;
        }
index dadba33..1d46f3b 100644 (file)
@@ -1194,8 +1194,11 @@ rte_eal_init(int argc, char **argv)
         * whether we are primary or secondary process, but we cannot remove
         * primary process' files because secondary should be able to run even
         * if primary process is dead.
+        *
+        * In no_shconf mode, no runtime directory is created in the first
+        * place, so no cleanup needed.
         */
-       if (eal_clean_runtime_dir() < 0) {
+       if (!internal_config.no_shconf && eal_clean_runtime_dir() < 0) {
                rte_eal_init_alert("Cannot clear runtime directory\n");
                return -1;
        }