Only unwatch if we were watching

This commit is contained in:
Jeremy Lakeman 2014-05-09 15:01:52 +09:30
parent 2a07093c5f
commit bb39bb871a

View File

@ -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;
}