>From 1cc53900cf6b176d8c8cf07f9d5c03b98b935c0c Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 15 Feb 2010 11:27:37 -0500
Subject: [PATCH] Kill ssh tunnel

---
 src/remote/remote_driver.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 13534ce..b979efa 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -947,13 +947,7 @@ doRemoteOpen (virConnectPtr conn,
         close (priv->sock);
 #ifndef WIN32
         if (priv->pid > 0) {
-            pid_t reap;
-            do {
-retry:
-                reap = waitpid(priv->pid, NULL, 0);
-                if (reap == -1 && errno == EINTR)
-                    goto retry;
-            } while (reap != -1 && reap != priv->pid);
+            kill(priv->pid, SIGKILL);
         }
 #endif
     }
@@ -1411,13 +1405,7 @@ doRemoteClose (virConnectPtr conn, struct private_data *priv)
 
 #ifndef WIN32
     if (priv->pid > 0) {
-        pid_t reap;
-        do {
-retry:
-            reap = waitpid(priv->pid, NULL, 0);
-            if (reap == -1 && errno == EINTR)
-                goto retry;
-        } while (reap != -1 && reap != priv->pid);
+        kill(priv->pid, SIGKILL);
     }
 #endif
     if (priv->wakeupReadFD >= 0) {
-- 
1.6.5.2

