summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-17 20:50:16 +0900
committerdaniel <danieruru@gmail.com>2013-01-17 20:50:16 +0900
commit67b0ff47c3866059695617b30deb1d18c250073e (patch)
tree287fbebaff000b41b3a308590024280ac8838765
parent74d4fb6c3b452599e9fc40c2f7df683bb1cf16d6 (diff)
If a client disconnects while holding a lock, clear the lock
-rw-r--r--vxi11_server.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vxi11_server.c b/vxi11_server.c
index 0f2c91d..1f0ac4f 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -391,6 +391,14 @@ destroy_link_1_svc(Device_Link *argp, struct svc_req *rqstp) {
if (!isValidLink(lid))
result.error = ERR_INVALIDLINKINDENTIFIER;
else {
+
+ if (haveLock(*argp)) {
+#ifdef DEBUG
+ printf("Disconnecting client was holding a lock, freeing it\n");
+#endif
+ unlock();
+ }
+
globals.Remote.vxi_connections--;
#ifdef DEBUG
printf("link %d destroyed, %d active links\n", lid, globals.Remote.vxi_connections);