diff lib-src/emacsserver.c @ 25261:89be69860eeb

(main): Move the dynamic allocation of system_name outside of the SERVER_HOME_DIR conditional.
author Karl Heuer <kwzh@gnu.org>
date Sat, 14 Aug 1999 04:08:25 +0000
parents 740c8322ca39
children 95f7147cb572
line wrap: on
line diff
--- a/lib-src/emacsserver.c	Sat Aug 14 03:55:01 1999 +0000
+++ b/lib-src/emacsserver.c	Sat Aug 14 04:08:25 1999 +0000
@@ -250,9 +250,8 @@
       exit (1);
     }
   server.sun_family = AF_UNIX;
-#ifndef SERVER_HOME_DIR
+
   system_name_length = 32;
-
   while (1)
     {
       system_name = (char *) xmalloc (system_name_length + 1);
@@ -267,6 +266,7 @@
       system_name_length *= 2;
     }
 
+#ifndef SERVER_HOME_DIR
   sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name);
 
   if (unlink (server.sun_path) == -1 && errno != ENOENT)
@@ -280,7 +280,6 @@
 
   strcpy (server.sun_path, homedir);
   strcat (server.sun_path, "/.emacs-server-");
-  gethostname (system_name, sizeof (system_name));
   strcat (server.sun_path, system_name);
   /* Delete anyone else's old server.  */
   unlink (server.sun_path);