swanctl: Stop logging with Ctrl+C on Windows as well
authorMartin Willi <martin@revosec.ch>
Thu, 6 Mar 2014 10:22:19 +0000 (11:22 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:12 +0000 (15:53 +0200)
src/swanctl/commands/log.c

index 4810025..10a748f 100644 (file)
@@ -73,10 +73,11 @@ static int logcmd(vici_conn_t *conn)
                fprintf(stderr, "registering for log failed: %s\n", strerror(errno));
                return errno;
        }
-       while (TRUE)
-       {
-               sleep(1);
-       }
+
+       wait_sigint();
+
+       fprintf(stderr, "disconnecting...\n");
+
        return 0;
 }