changeset 5735:87611653922f

(x_get_customization_string): Use get_system_name instead of gethostname.
author Karl Heuer <kwzh@gnu.org>
date Wed, 02 Feb 1994 06:26:21 +0000
parents 3c8ae6c720d8
children 6f199038b06d
files src/xrdb.c
diffstat 1 files changed, 4 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/xrdb.c	Wed Feb 02 06:20:58 1994 +0000
+++ b/src/xrdb.c	Wed Feb 02 06:26:21 1994 +0000
@@ -77,6 +77,8 @@
 extern struct passwd *getpwnam ();
 #endif
 
+extern char *get_system_name ();
+
 /* Make sure not to #include anything after these definitions.  Let's
    not step on anyone's prototypes.  */
 #ifdef emacs
@@ -481,26 +483,12 @@
 {
   XrmDatabase db;
   char *p;
-  char *path = 0, *home = 0, *host = 0;
+  char *path = 0, *home = 0, *host;
 
   if ((p = getenv ("XENVIRONMENT")) == NULL)
     {
       home = gethomedir ();
-
-      {
-	int host_size = 100;
-	host = (char *) malloc (host_size);
-	
-	for (;;)
-	  {
-	    host[host_size - 1] = '\0';
-	    gethostname (host, host_size - 1);
-	    if (strlen (host) < host_size - 1)
-	      break;
-	    host = (char *) realloc (host, host_size *= 2);
-	  }
-      }
-
+      host = get_system_name ();
       path = (char *) malloc (strlen (home)
 			      + sizeof (".Xdefaults-")
 			      + strlen (host));
@@ -512,7 +500,6 @@
 
   if (path) free (path);
   if (home) free (home);
-  if (host) free (host);
 
   return db;
 }