Fix waitpid() call to only run in error case (merge error)

This commit is contained in:
Daniel P. Berrange 2007-09-19 21:44:32 +00:00
parent 27b4293285
commit 736f0e2531
2 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,8 @@
Wed Sep 19 17:42:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/remote_internal.c: Fix waitpid() call to only be done
in doRemoteOpen error case (merge error from previous commit)
Wed Sep 19 13:39:00 EST 2007 Daniel P. Berrange <berrange@redhat.com> Wed Sep 19 13:39:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* configure.in: Use pkg-config to locate gnutls if pkg-config * configure.in: Use pkg-config to locate gnutls if pkg-config

View File

@ -647,14 +647,14 @@ doRemoteOpen (virConnectPtr conn, struct private_data *priv, const char *uri_str
if (priv->uses_tls && priv->session) if (priv->uses_tls && priv->session)
gnutls_bye (priv->session, GNUTLS_SHUT_RDWR); gnutls_bye (priv->session, GNUTLS_SHUT_RDWR);
close (priv->sock); close (priv->sock);
} if (priv->pid > 0) {
if (priv->pid > 0) { pid_t reap;
pid_t reap; do {
do { reap = waitpid(priv->pid, NULL, 0);
reap = waitpid(priv->pid, NULL, 0); if (reap == -1 && errno == EINTR)
if (reap == -1 && errno == EINTR) continue;
continue; } while (reap != -1 && reap != priv->pid);
} while (reap != -1 && reap != priv->pid); }
} }
/* Free up the URL and strings. */ /* Free up the URL and strings. */