From bb39bb871af4611ea5abaff97a3f1a990cc524a8 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Fri, 9 May 2014 15:01:52 +0930 Subject: [PATCH] Only unwatch if we were watching --- msp_proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msp_proxy.c b/msp_proxy.c index 8a41607f..b4c9cf25 100644 --- a/msp_proxy.c +++ b/msp_proxy.c @@ -573,9 +573,9 @@ end: mdp_close(mdp_sock.poll.fd); mdp_sock.poll.fd=-1; } - if (is_watching(&service_sock)) - unwatch(&service_sock); if (service_sock.poll.fd!=-1){ + if (is_watching(&service_sock)) + unwatch(&service_sock); mdp_close(service_sock.poll.fd); service_sock.poll.fd=-1; }