From 8658bbc902edfb8ff4998d3136a8a5e1ff5803db Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Fri, 9 Nov 2012 16:10:55 +0000 Subject: [PATCH] instead of relying on yyterminate to clean up the lex context call the destroy functions directly (after closing the file) This commit was SVN r27577. --- ompi/mca/btl/openib/btl_openib_ini.c | 1 + ompi/mca/btl/openib/btl_openib_lex.l | 3 --- ompi/mca/btl/wv/btl_wv_ini.c | 1 + ompi/mca/btl/wv/btl_wv_lex.l | 3 --- ompi/mca/coll/ml/coll_ml_config.c | 1 + ompi/mca/coll/ml/coll_ml_lex.l | 3 --- opal/util/keyval/keyval_lex.l | 3 --- opal/util/keyval_parse.c | 1 + orte/mca/rmaps/rank_file/rmaps_rank_file.c | 4 ++-- 9 files changed, 6 insertions(+), 14 deletions(-) diff --git a/ompi/mca/btl/openib/btl_openib_ini.c b/ompi/mca/btl/openib/btl_openib_ini.c index f13156d416..88138506b9 100644 --- a/ompi/mca/btl/openib/btl_openib_ini.c +++ b/ompi/mca/btl/openib/btl_openib_ini.c @@ -305,6 +305,7 @@ static int parse_file(char *filename) } save_section(§ion); fclose(btl_openib_ini_yyin); + btl_openib_ini_yylex_destroy (); cleanup: reset_section(true, §ion); diff --git a/ompi/mca/btl/openib/btl_openib_lex.l b/ompi/mca/btl/openib/btl_openib_lex.l index a5b6eab9d9..8d784a9e70 100644 --- a/ompi/mca/btl/openib/btl_openib_lex.l +++ b/ompi/mca/btl/openib/btl_openib_lex.l @@ -45,9 +45,6 @@ int btl_openib_ini_yynewlines = 1; bool btl_openib_ini_parse_done = false; char *btl_openib_ini_string = NULL; -#define yyterminate() \ - return btl_openib_ini_yylex_destroy () - %} WHITE [\f\t\v ] diff --git a/ompi/mca/btl/wv/btl_wv_ini.c b/ompi/mca/btl/wv/btl_wv_ini.c index dd593e9913..27e7539df0 100644 --- a/ompi/mca/btl/wv/btl_wv_ini.c +++ b/ompi/mca/btl/wv/btl_wv_ini.c @@ -299,6 +299,7 @@ static int parse_file(char *filename) } save_section(§ion); fclose(btl_wv_ini_yyin); + btl_wv_ini_yylex_destroy (); cleanup: reset_section(true, §ion); diff --git a/ompi/mca/btl/wv/btl_wv_lex.l b/ompi/mca/btl/wv/btl_wv_lex.l index 5719df2487..d58c92410b 100644 --- a/ompi/mca/btl/wv/btl_wv_lex.l +++ b/ompi/mca/btl/wv/btl_wv_lex.l @@ -43,9 +43,6 @@ int btl_wv_ini_yynewlines = 1; bool btl_wv_ini_parse_done = false; char *btl_wv_ini_string = NULL; -#define yyterminate() \ - return btl_wv_ini_yylex_destroy() - %} WHITE [\f\t\v ] diff --git a/ompi/mca/coll/ml/coll_ml_config.c b/ompi/mca/coll/ml/coll_ml_config.c index 741f1d50d5..6aa1e69be7 100644 --- a/ompi/mca/coll/ml/coll_ml_config.c +++ b/ompi/mca/coll/ml/coll_ml_config.c @@ -551,6 +551,7 @@ static int parse_file(char *filename) } save_settings(&coll_config); fclose(coll_ml_config_yyin); + coll_ml_config_yylex_destroy (); ret = OMPI_SUCCESS; cleanup: diff --git a/ompi/mca/coll/ml/coll_ml_lex.l b/ompi/mca/coll/ml/coll_ml_lex.l index 741be0940d..73098bb4b1 100644 --- a/ompi/mca/coll/ml/coll_ml_lex.l +++ b/ompi/mca/coll/ml/coll_ml_lex.l @@ -26,9 +26,6 @@ int coll_ml_config_yynewlines = 1; bool coll_ml_config_parse_done = false; char *coll_ml_config_string = NULL; -#define yyterminate() \ - return coll_ml_config_yylex_destroy() - %} WHITE [\f\t\v ] diff --git a/opal/util/keyval/keyval_lex.l b/opal/util/keyval/keyval_lex.l index 9bdc5b1ebd..1281c22cd2 100644 --- a/opal/util/keyval/keyval_lex.l +++ b/opal/util/keyval/keyval_lex.l @@ -47,9 +47,6 @@ int opal_util_keyval_yynewlines = 1; bool opal_util_keyval_parse_done = false; char *opal_util_keyval_string = NULL; -#define yyterminate() \ - return opal_util_keyval_yylex_destroy() - %} WHITE [\f\t\v ] diff --git a/opal/util/keyval_parse.c b/opal/util/keyval_parse.c index e04743ea9c..5ad4c4ac07 100644 --- a/opal/util/keyval_parse.c +++ b/opal/util/keyval_parse.c @@ -83,6 +83,7 @@ opal_util_keyval_parse(const char *filename, } } fclose(opal_util_keyval_yyin); + opal_util_keyval_yylex_destroy (); cleanup: OPAL_THREAD_UNLOCK(&keyval_mutex); diff --git a/orte/mca/rmaps/rank_file/rmaps_rank_file.c b/orte/mca/rmaps/rank_file/rmaps_rank_file.c index 4c4d3d3e81..74d468db04 100644 --- a/orte/mca/rmaps/rank_file/rmaps_rank_file.c +++ b/orte/mca/rmaps/rank_file/rmaps_rank_file.c @@ -503,8 +503,8 @@ static int orte_rmaps_rank_file_parse(const char *rankfile) } } fclose(orte_rmaps_rank_file_in); - orte_rmaps_rank_file_in = NULL; - + orte_rmaps_rank_file_lex_destroy (); + unlock: if (NULL != node_name) { free(node_name);