I tested this patch with the latest sources and got a weird situation where vtysh shell doesn't exit. "end", "exit", "quit" failed to make it do so. I moved the #ifdef DEV_BUILD inside the if statement to cover only the fprintf statement and that fixed it. The reason I think is that the ifdef prevents an early bailout (return) that takes place in the normal case. HEre is the code looks:

  if (hash_lookup (cnode->cmd_hash, cmd) != NULL)
    {
      fprintf (stderr,
               "Multiple command installs to node %d of command:\n%s\n",
               ntype, cmd->string);
      return;
    }

  assert (hash_get (cnode->cmd_hash, cmd, hash_alloc_intern));


The ifdef should only be around the fprintf statement. I have to NACK this patch.

Regards,
Jafar


On 10/29/2016 6:17 PM, Nick Hilliard wrote:
commit 92193665 warns about duplicate node installs.  This should only be
enabled for dev builds beacuse it causes unwanted noise on production
builds.  I've enclosed the relevant commands in #ifdef DEV_BUILD, which may
or may not be appropriate.  If there's a more appropriate compile-time
option available, that could be used instead.

---
  lib/command.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/lib/command.c b/lib/command.c
index ab46fc4..14da6f7 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -636,6 +636,7 @@ install_element (enum node_type ntype, struct cmd_element 
*cmd)
        exit (1);
      }
+#ifdef DEV_BUILD
    if (hash_lookup (cnode->cmd_hash, cmd) != NULL)
      {
        fprintf (stderr,
@@ -645,6 +646,7 @@ install_element (enum node_type ntype, struct cmd_element 
*cmd)
      }
assert (hash_get (cnode->cmd_hash, cmd, hash_alloc_intern));
+#endif
vector_set (cnode->cmd_vector, cmd);
    if (cmd->tokens == NULL)


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to