summaryrefslogtreecommitdiff
path: root/src/swanctl/commands/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/swanctl/commands/log.c')
-rw-r--r--src/swanctl/commands/log.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/swanctl/commands/log.c b/src/swanctl/commands/log.c
index 99ba328a7..d7082bfca 100644
--- a/src/swanctl/commands/log.c
+++ b/src/swanctl/commands/log.c
@@ -50,6 +50,7 @@ static int logcmd(vici_conn_t *conn)
{
command_format_options_t format = COMMAND_FORMAT_NONE;
char *arg;
+ int ret;
while (TRUE)
{
@@ -73,8 +74,9 @@ static int logcmd(vici_conn_t *conn)
if (vici_register(conn, "log", log_cb, &format) != 0)
{
+ ret = errno;
fprintf(stderr, "registering for log failed: %s\n", strerror(errno));
- return errno;
+ return ret;
}
wait_sigint();