From a59a99f218e7d4bfd343f2cde34df544b56e7212 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 12 Jul 2011 12:09:43 -0600 Subject: [PATCH] virnetsocket: use new API for uniform child cleanup Rather than trying to clean up the ssh child ourselves, and risk subtle differences from the socket creation error path, we can just use the new APIs. * src/rpc/virnetsocket.c (virNetSocketFree): Use new function. --- src/rpc/virnetsocket.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 41d9954e66..7ea1ab7720 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -652,18 +652,7 @@ void virNetSocketFree(virNetSocketPtr sock) VIR_FORCE_CLOSE(sock->fd); VIR_FORCE_CLOSE(sock->errfd); -#ifndef WIN32 - if (sock->pid > 0) { - pid_t reap; - kill(sock->pid, SIGTERM); - do { -retry: - reap = waitpid(sock->pid, NULL, 0); - if (reap == -1 && errno == EINTR) - goto retry; - } while (reap != -1 && reap != sock->pid); - } -#endif + virPidAbort(sock->pid); VIR_FREE(sock->localAddrStr); VIR_FREE(sock->remoteAddrStr);