]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Replace gethostname by virGetHostname in xend_internal.c
authorChris Lalancette <clalance@redhat.com>
Fri, 23 Oct 2009 10:02:46 +0000 (12:02 +0200)
committerChris Lalancette <clalance@redhat.com>
Mon, 26 Oct 2009 09:32:19 +0000 (10:32 +0100)
src/xen/xend_internal.c

index 27d215e40a507896ccf8100cce7a81a19ffb9da3..d3ab019c5e105cbddf2149e359ad2e87c4ceb12d 100644 (file)
@@ -4342,21 +4342,12 @@ xenDaemonDomainMigratePrepare (virConnectPtr dconn,
                                const char *dname ATTRIBUTE_UNUSED,
                                unsigned long resource ATTRIBUTE_UNUSED)
 {
-    int r;
-    char hostname [HOST_NAME_MAX+1];
-
     /* If uri_in is NULL, get the current hostname as a best guess
      * of how the source host should connect to us.  Note that caller
      * deallocates this string.
      */
     if (uri_in == NULL) {
-        r = gethostname (hostname, HOST_NAME_MAX+1);
-        if (r == -1) {
-            virReportSystemError(dconn, errno,
-                                 _("unable to resolve name %s"), hostname);
-            return -1;
-        }
-        *uri_out = strdup (hostname);
+        *uri_out = virGetHostname();
         if (*uri_out == NULL) {
             virReportOOMError(dconn);
             return -1;