summaryrefslogtreecommitdiff
path: root/src/swanctl/commands/list_conns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/swanctl/commands/list_conns.c')
-rw-r--r--src/swanctl/commands/list_conns.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/swanctl/commands/list_conns.c b/src/swanctl/commands/list_conns.c
index ec5da4bef..31ab9c40a 100644
--- a/src/swanctl/commands/list_conns.c
+++ b/src/swanctl/commands/list_conns.c
@@ -183,6 +183,7 @@ static int list_conns(vici_conn_t *conn)
vici_res_t *res;
command_format_options_t format = COMMAND_FORMAT_NONE;
char *arg;
+ int ret;
while (TRUE)
{
@@ -205,16 +206,18 @@ static int list_conns(vici_conn_t *conn)
}
if (vici_register(conn, "list-conn", list_cb, &format) != 0)
{
+ ret = errno;
fprintf(stderr, "registering for connections failed: %s\n",
strerror(errno));
- return errno;
+ return ret;
}
req = vici_begin("list-conns");
res = vici_submit(req, conn);
if (!res)
{
+ ret = errno;
fprintf(stderr, "list-conns request failed: %s\n", strerror(errno));
- return errno;
+ return ret;
}
if (format & COMMAND_FORMAT_RAW)
{