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 <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
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]);
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)) {
}
ovsdb_idl_destroy(nb_ctx.idl);
- exit(0);
+ exit(res);
}