From: Eric Blake Date: Tue, 12 Jul 2011 18:09:43 +0000 (-0600) Subject: virnetsocket: use new API for uniform child cleanup X-Git-Tag: v0.9.4-rc1~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a59a99f218e7d4bfd343f2cde34df544b56e7212;p=thirdparty%2Flibvirt.git 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. --- 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);