<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6875">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Richard Mudgett: Looks good to me, approved

</div><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;">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/6875">change 6875</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/6875"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ifd679509a23ed163e5cc647490bf7df4ae3cd856 </div>
<div style="display:none"> Gerrit-Change-Number: 6875 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>