From 8c86eccda43fb8b2cd8069445f07b3d347c7efe4 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Wed, 2 Feb 1994 06:32:28 +0000 Subject: [PATCH] (x_term_init): Use get_system_name instead of gethostname. --- src/xterm.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index cc7f9aa708..0b3c6dd91a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5194,30 +5194,10 @@ Check the DISPLAY environment variable or use \"-d\"\n", #ifdef HAVE_X11 { - int hostname_size = 256; - - hostname = (char *) xmalloc (hostname_size); - #if 0 XSetAfterFunction (x_current_display, x_trace_wire); #endif /* ! 0 */ - - /* Try to get the host name; if the buffer is too short, try - again. Apparently, the only indication gethostname gives of - whether the buffer was large enough is the presence or absence - of a '\0' in the string. Eech. */ - for (;;) - { - gethostname (hostname, hostname_size - 1); - hostname[hostname_size - 1] = '\0'; - - /* Was the buffer large enough for gethostname to store the '\0'? */ - if (strlen (hostname) < hostname_size - 1) - break; - - hostname_size <<= 1; - hostname = (char *) xrealloc (hostname, hostname_size); - } + hostname = get_system_name (); x_id_name = (char *) xmalloc (XSTRING (Vinvocation_name)->size + strlen (hostname) + 2); -- 2.20.1