render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Daniel P. Berrange 511f6c
Index: src/remote_internal.c
Daniel P. Berrange 511f6c
===================================================================
Daniel P. Berrange 511f6c
RCS file: /data/cvs/libxen/src/remote_internal.c,v
Daniel P. Berrange 511f6c
retrieving revision 1.141
Daniel P. Berrange 511f6c
diff -u -u -p -r1.141 remote_internal.c
Daniel P. Berrange 511f6c
--- src/remote_internal.c	3 Mar 2009 19:33:34 -0000	1.141
Daniel P. Berrange 511f6c
+++ src/remote_internal.c	16 Mar 2009 16:57:17 -0000
Daniel P. Berrange 511f6c
@@ -332,7 +332,7 @@ doRemoteOpen (virConnectPtr conn,
Daniel P. Berrange 511f6c
               virConnectAuthPtr auth ATTRIBUTE_UNUSED,
Daniel P. Berrange 511f6c
               int flags)
Daniel P. Berrange 511f6c
 {
Daniel P. Berrange 511f6c
-    int wakeupFD[2];
Daniel P. Berrange 511f6c
+    int wakeupFD[2] = { -1, -1 };
Daniel P. Berrange 511f6c
     char *transport_str = NULL;
Daniel P. Berrange 511f6c
 
Daniel P. Berrange 511f6c
     if (conn->uri) {
Daniel P. Berrange 511f6c
@@ -885,6 +885,11 @@ doRemoteOpen (virConnectPtr conn,
Daniel P. Berrange 511f6c
 #endif
Daniel P. Berrange 511f6c
     }
Daniel P. Berrange 511f6c
 
Daniel P. Berrange 511f6c
+    if (wakeupFD[0] >= 0) {
Daniel P. Berrange 511f6c
+        close(wakeupFD[0]);
Daniel P. Berrange 511f6c
+	close(wakeupFD[1]);
Daniel P. Berrange 511f6c
+    }
Daniel P. Berrange 511f6c
+
Daniel P. Berrange 511f6c
     VIR_FREE(priv->hostname);
Daniel P. Berrange 511f6c
     goto cleanup;
Daniel P. Berrange 511f6c
 }
Daniel P. Berrange 511f6c
@@ -1350,6 +1355,11 @@ doRemoteClose (virConnectPtr conn, struc
Daniel P. Berrange 511f6c
         } while (reap != -1 && reap != priv->pid);
Daniel P. Berrange 511f6c
     }
Daniel P. Berrange 511f6c
 #endif
Daniel P. Berrange 511f6c
+    if (priv->wakeupReadFD >= 0) {
Daniel P. Berrange 511f6c
+        close(priv->wakeupReadFD);
Daniel P. Berrange 511f6c
+	close(priv->wakeupSendFD);
Daniel P. Berrange 511f6c
+    }
Daniel P. Berrange 511f6c
+
Daniel P. Berrange 511f6c
 
Daniel P. Berrange 511f6c
     /* Free hostname copy */
Daniel P. Berrange 511f6c
     free (priv->hostname);