summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1999-08-14 04:08:25 +0000
committerKarl Heuer <kwzh@gnu.org>1999-08-14 04:08:25 +0000
commitc5fee54517a65d1aa07253dd8f434e0d9cfc9c03 (patch)
tree6552ad6773b464fb7bc0ce20e548a9933edb535c /lib-src
parent65a44e9fc083277175c8089bb0692a895df9cb66 (diff)
downloademacs-c5fee54517a65d1aa07253dd8f434e0d9cfc9c03.tar.gz
(main): Move the dynamic allocation of
system_name outside of the SERVER_HOME_DIR conditional.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c9
-rw-r--r--lib-src/emacsserver.c5
2 files changed, 8 insertions, 6 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index eb2f7d9d6e9..0e88e2edc12 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -219,9 +219,8 @@ main (argc, argv)
exit (1);
}
server.sun_family = AF_UNIX;
-#ifndef SERVER_HOME_DIR
+
{
- struct stat statbfr;
system_name_length = 32;
while (1)
@@ -237,6 +236,11 @@ main (argc, argv)
free (system_name);
system_name_length *= 2;
}
+ }
+
+#ifndef SERVER_HOME_DIR
+ {
+ struct stat statbfr;
sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name);
@@ -265,7 +269,6 @@ main (argc, argv)
}
strcpy (server.sun_path, homedir);
strcat (server.sun_path, "/.emacs-server-");
- gethostname (system_name, sizeof (system_name));
strcat (server.sun_path, system_name);
#endif
diff --git a/lib-src/emacsserver.c b/lib-src/emacsserver.c
index fa3c3403655..e58cf231933 100644
--- a/lib-src/emacsserver.c
+++ b/lib-src/emacsserver.c
@@ -250,9 +250,8 @@ main (argc, argv)
exit (1);
}
server.sun_family = AF_UNIX;
-#ifndef SERVER_HOME_DIR
- system_name_length = 32;
+ system_name_length = 32;
while (1)
{
system_name = (char *) xmalloc (system_name_length + 1);
@@ -267,6 +266,7 @@ main (argc, argv)
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 @@ main (argc, argv)
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);