ORBit2 r2052 - in trunk/linc2: . src



Author: liyuan
Date: Thu Apr 10 10:29:08 2008
New Revision: 2052
URL: http://svn.gnome.org/viewvc/ORBit2?rev=2052&view=rev

Log:
2008-04-10  Li Yuan  <li yuan sun com>

        * src/linc-protocols.c: (link_get_local_hostname),
        (link_use_local_hostname):
        Bug #527128.
        Refresh local_host when use_local_host is changed.


Modified:
   trunk/linc2/ChangeLog
   trunk/linc2/src/linc-protocols.c

Modified: trunk/linc2/src/linc-protocols.c
==============================================================================
--- trunk/linc2/src/linc-protocols.c	(original)
+++ trunk/linc2/src/linc-protocols.c	Thu Apr 10 10:29:08 2008
@@ -36,6 +36,7 @@
 static LinkNetIdType use_local_host = LINK_NET_ID_IS_FQDN;
 #endif
 static const char *fixed_host_net_id = NULL;
+static char local_host[NI_MAXHOST] = { 0 };
 
 /*
  * make_local_tmpdir:
@@ -314,8 +315,6 @@
 const char *
 link_get_local_hostname (void)
 {
-	static char local_host[NI_MAXHOST] = { 0 };
-
 	if (local_host[0])
 		return local_host;
 
@@ -327,7 +326,10 @@
 void
 link_use_local_hostname (LinkNetIdType use)
 {
-        use_local_host = use;
+	if (use_local_host != use) {
+		get_netid(use, local_host, NI_MAXHOST);
+        	use_local_host = use;
+	}
 }
 
 void 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]