aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorKarl Heuer1994-02-02 06:32:28 +0000
committerKarl Heuer1994-02-02 06:32:28 +0000
commit8c86eccda43fb8b2cd8069445f07b3d347c7efe4 (patch)
tree6a799c3d37d58ad7bf4c42e787b778011ef15a7f /src/xterm.c
parent352b6a9e76503d19e59e63d64c24eb3f2fdc10b7 (diff)
downloademacs-8c86eccda43fb8b2cd8069445f07b3d347c7efe4.tar.gz
emacs-8c86eccda43fb8b2cd8069445f07b3d347c7efe4.zip
(x_term_init): Use get_system_name instead of gethostname.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/xterm.c b/src/xterm.c
index cc7f9aa7089..0b3c6dd91a8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5194,30 +5194,10 @@ Check the DISPLAY environment variable or use \"-d\"\n",
5194 5194
5195#ifdef HAVE_X11 5195#ifdef HAVE_X11
5196 { 5196 {
5197 int hostname_size = 256;
5198
5199 hostname = (char *) xmalloc (hostname_size);
5200
5201#if 0 5197#if 0
5202 XSetAfterFunction (x_current_display, x_trace_wire); 5198 XSetAfterFunction (x_current_display, x_trace_wire);
5203#endif /* ! 0 */ 5199#endif /* ! 0 */
5204 5200 hostname = get_system_name ();
5205 /* Try to get the host name; if the buffer is too short, try
5206 again. Apparently, the only indication gethostname gives of
5207 whether the buffer was large enough is the presence or absence
5208 of a '\0' in the string. Eech. */
5209 for (;;)
5210 {
5211 gethostname (hostname, hostname_size - 1);
5212 hostname[hostname_size - 1] = '\0';
5213
5214 /* Was the buffer large enough for gethostname to store the '\0'? */
5215 if (strlen (hostname) < hostname_size - 1)
5216 break;
5217
5218 hostname_size <<= 1;
5219 hostname = (char *) xrealloc (hostname, hostname_size);
5220 }
5221 x_id_name = (char *) xmalloc (XSTRING (Vinvocation_name)->size 5201 x_id_name = (char *) xmalloc (XSTRING (Vinvocation_name)->size
5222 + strlen (hostname) 5202 + strlen (hostname)
5223 + 2); 5203 + 2);