From 9b8e801777f2bcc15c6ca1caffca3236b8cf2b75 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 6 May 2017 21:17:28 +0200 Subject: Add more cleanup code on connection loss --- vchat-client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vchat-client.c') diff --git a/vchat-client.c b/vchat-client.c index a2e298c..0e480be 100755 --- a/vchat-client.c +++ b/vchat-client.c @@ -355,8 +355,10 @@ cleanup (int signal) /* clear userlist */ ul_clear (); /* close server connection */ - if (serverfd > 0) + if (serverfd > 0) { close (serverfd); + serverfd = -1; + } /* inform user if we where killed by signal */ if (signal > 1) { -- cgit v1.2.3