On Tue, Mar 31, 2015 at 12:43 PM, Russell Bryant <rbry...@redhat.com> wrote:

> The main loop of ovn-nbctl had a condition to catch if the conenction
> to the db was lost.  However, it didn't break out of the loop when the
> condition occurred.  Now it should log the error once and exit with a
> non-zero status code.
>
> Signed-off-by: Russell Bryant <rbry...@redhat.com>
> ---
>  ovn/ovn-nbctl.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/ovn/ovn-nbctl.c b/ovn/ovn-nbctl.c
> index b470e9f..3837341 100644
> --- a/ovn/ovn-nbctl.c
> +++ b/ovn/ovn-nbctl.c
> @@ -583,6 +583,7 @@ main(int argc, char *argv[])
>      struct nbctl_context nb_ctx = { .idl = NULL, };
>      enum ovsdb_idl_txn_status txn_status;
>      unsigned int seqno;
> +    int res = 0;
>
>      fatal_ignore_sigpipe();
>      set_program_name(argv[0]);
> @@ -604,6 +605,8 @@ main(int argc, char *argv[])
>              int retval = ovsdb_idl_get_last_error(nb_ctx.idl);
>              VLOG_ERR("%s: database connection failed (%s)",
>                      db, ovs_retval_to_string(retval));
> +            res = 1;
> +            break;
>          }
>
>          if (seqno != ovsdb_idl_get_seqno(nb_ctx.idl)) {
> @@ -628,5 +631,5 @@ main(int argc, char *argv[])
>      }
>      ovsdb_idl_destroy(nb_ctx.idl);
>
> -    exit(0);
> +    exit(res);
>  }
> --
> 2.1.0
>
> Looks fine to me.

Acked-by: Kyle Mestery <mest...@mestery.com>


> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to