Commit 9ccad6c3 authored by Cedric Roux's avatar Cedric Roux

T: minor: close socket

Sometimes when the user does ctrl+c to quit, it may not quit
if nothing comes on the socket. Closing the socket in the
signal handler fixes this.
parent 4a1458e9
......@@ -4,6 +4,7 @@
#include <stdint.h>
#include <inttypes.h>
#include <signal.h>
#include <unistd.h>
#include "database.h"
#include "utils.h"
#include "handler.h"
......@@ -181,10 +182,13 @@ void usage(void)
}
int run = 1;
static int socket = -1;
void force_stop(int x)
{
printf("\ngently quit...\n");
close(socket);
socket = -1;
run = 0;
}
......@@ -198,7 +202,6 @@ int main(int n, char **v)
int *is_on;
int number_of_events;
int i;
int socket;
vcd_vars vars[n];
int nvars = 0;
view *vcd_view;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment