<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6874">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">test_config: Fix failure and segfault when config_hook is run twice.<br><br>On second run the config_hook test was unexpectedly failing to load<br>test_config.conf because it was still unmodified since the last load.<br>This is fixed by not passing CONFIG_FLAG_FILEUNCHANGED for the initial<br>loads, only using it when we are tested that a reload of unmodified<br>files do not initiate the hook.<br><br>ASTERISK-25960<br><br>Change-Id: Ifd679509a23ed163e5cc647490bf7df4ae3cd856<br>---<br>M tests/test_config.c<br>1 file changed, 3 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/74/6874/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/test_config.c b/tests/test_config.c<br>index 8675cb8..d74726a 100644<br>--- a/tests/test_config.c<br>+++ b/tests/test_config.c<br>@@ -957,7 +957,8 @@<br> {<br> enum ast_test_result_state res = AST_TEST_FAIL;<br> enum config_hook_flags hook_flags = { 0, };<br>- struct ast_flags config_flags = { CONFIG_FLAG_FILEUNCHANGED };<br>+ struct ast_flags config_flags = { 0 };<br>+ struct ast_flags reload_flags = { CONFIG_FLAG_FILEUNCHANGED };<br> struct ast_config *cfg;<br> <br> switch (cmd) {<br>@@ -1025,7 +1026,7 @@<br> * Hook should not run<br> */<br> hook_run = 0;<br>- cfg = ast_config_load(CONFIG_FILE, config_flags);<br>+ cfg = ast_config_load(CONFIG_FILE, reload_flags);<br> /* Only destroy this cfg conditionally. Otherwise a crash happens. */<br> if (cfg != CONFIG_STATUS_FILEUNCHANGED) {<br> ast_config_destroy(cfg);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6874">change 6874</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6874"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ifd679509a23ed163e5cc647490bf7df4ae3cd856 </div>
<div style="display:none"> Gerrit-Change-Number: 6874 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>