summaryrefslogtreecommitdiff
path: root/vtep/vtep-ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vtep/vtep-ctl.c')
-rw-r--r--vtep/vtep-ctl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c
index 3af71498b..056dc687a 100644
--- a/vtep/vtep-ctl.c
+++ b/vtep/vtep-ctl.c
@@ -82,7 +82,7 @@ OVS_NO_RETURN static void usage(void);
static void parse_options(int argc, char *argv[], struct shash *local_options);
static void run_prerequisites(struct ctl_command[], size_t n_commands,
struct ovsdb_idl *);
-static void do_vtep_ctl(const char *args, struct ctl_command *, size_t n,
+static bool do_vtep_ctl(const char *args, struct ctl_command *, size_t n,
struct ovsdb_idl *);
static struct vtep_ctl_lswitch *find_lswitch(struct vtep_ctl_context *,
const char *name,
@@ -144,7 +144,10 @@ main(int argc, char *argv[])
if (seqno != ovsdb_idl_get_seqno(idl)) {
seqno = ovsdb_idl_get_seqno(idl);
- do_vtep_ctl(args, commands, n_commands, idl);
+ if (do_vtep_ctl(args, commands, n_commands, idl)) {
+ free(args);
+ exit(EXIT_SUCCESS);
+ }
}
if (seqno == ovsdb_idl_get_seqno(idl)) {
@@ -2257,7 +2260,7 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands,
}
}
-static void
+static bool
do_vtep_ctl(const char *args, struct ctl_command *commands,
size_t n_commands, struct ovsdb_idl *idl)
{
@@ -2405,7 +2408,7 @@ do_vtep_ctl(const char *args, struct ctl_command *commands,
ovsdb_idl_destroy(idl);
- exit(EXIT_SUCCESS);
+ return true;
try_again:
/* Our transaction needs to be rerun, or a prerequisite was not met. Free
@@ -2421,6 +2424,7 @@ try_again:
free(c->table);
}
free(error);
+ return false;
}
static const struct ctl_command_syntax vtep_commands[] = {