diff options
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 5a9e1a510..25e76b5af 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -14567,13 +14567,28 @@ static int setup_dahdi(int reload) return 0; } else if (cfg == CONFIG_STATUS_FILEUNCHANGED) { ucfg = ast_config_load("users.conf", config_flags); - if (ucfg == CONFIG_STATUS_FILEUNCHANGED) + if (ucfg == CONFIG_STATUS_FILEUNCHANGED) { return 0; + } else if (ucfg == CONFIG_STATUS_FILEINVALID) { + ast_log(LOG_ERROR, "File users.conf cannot be parsed. Aborting.\n"); + return 0; + } ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED); - cfg = ast_config_load(config, config_flags); + if ((cfg = ast_config_load(config, config_flags)) == CONFIG_STATUS_FILEINVALID) { + ast_log(LOG_ERROR, "File %s cannot be parsed. Aborting.\n", config); + ast_config_destroy(ucfg); + return 0; + } + } else if (cfg == CONFIG_STATUS_FILEINVALID) { + ast_log(LOG_ERROR, "File %s cannot be parsed. Aborting.\n", config); + return 0; } else { ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED); - ucfg = ast_config_load("users.conf", config_flags); + if ((ucfg = ast_config_load("users.conf", config_flags)) == CONFIG_STATUS_FILEINVALID) { + ast_log(LOG_ERROR, "File users.conf cannot be parsed. Aborting.\n"); + ast_config_destroy(cfg); + return 0; + } } /* It's a little silly to lock it, but we mind as well just to be sure */ |