diff options
| author | Karl Heuer | 1999-08-14 04:08:25 +0000 |
|---|---|---|
| committer | Karl Heuer | 1999-08-14 04:08:25 +0000 |
| commit | c5fee54517a65d1aa07253dd8f434e0d9cfc9c03 (patch) | |
| tree | 6552ad6773b464fb7bc0ce20e548a9933edb535c /lib-src | |
| parent | 65a44e9fc083277175c8089bb0692a895df9cb66 (diff) | |
| download | emacs-c5fee54517a65d1aa07253dd8f434e0d9cfc9c03.tar.gz emacs-c5fee54517a65d1aa07253dd8f434e0d9cfc9c03.zip | |
(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.c | 9 | ||||
| -rw-r--r-- | lib-src/emacsserver.c | 5 |
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) | |||
| 219 | exit (1); | 219 | exit (1); |
| 220 | } | 220 | } |
| 221 | server.sun_family = AF_UNIX; | 221 | server.sun_family = AF_UNIX; |
| 222 | #ifndef SERVER_HOME_DIR | 222 | |
| 223 | { | 223 | { |
| 224 | struct stat statbfr; | ||
| 225 | system_name_length = 32; | 224 | system_name_length = 32; |
| 226 | 225 | ||
| 227 | while (1) | 226 | while (1) |
| @@ -237,6 +236,11 @@ main (argc, argv) | |||
| 237 | free (system_name); | 236 | free (system_name); |
| 238 | system_name_length *= 2; | 237 | system_name_length *= 2; |
| 239 | } | 238 | } |
| 239 | } | ||
| 240 | |||
| 241 | #ifndef SERVER_HOME_DIR | ||
| 242 | { | ||
| 243 | struct stat statbfr; | ||
| 240 | 244 | ||
| 241 | sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); | 245 | sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); |
| 242 | 246 | ||
| @@ -265,7 +269,6 @@ main (argc, argv) | |||
| 265 | } | 269 | } |
| 266 | strcpy (server.sun_path, homedir); | 270 | strcpy (server.sun_path, homedir); |
| 267 | strcat (server.sun_path, "/.emacs-server-"); | 271 | strcat (server.sun_path, "/.emacs-server-"); |
| 268 | gethostname (system_name, sizeof (system_name)); | ||
| 269 | strcat (server.sun_path, system_name); | 272 | strcat (server.sun_path, system_name); |
| 270 | #endif | 273 | #endif |
| 271 | 274 | ||
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) | |||
| 250 | exit (1); | 250 | exit (1); |
| 251 | } | 251 | } |
| 252 | server.sun_family = AF_UNIX; | 252 | server.sun_family = AF_UNIX; |
| 253 | #ifndef SERVER_HOME_DIR | ||
| 254 | system_name_length = 32; | ||
| 255 | 253 | ||
| 254 | system_name_length = 32; | ||
| 256 | while (1) | 255 | while (1) |
| 257 | { | 256 | { |
| 258 | system_name = (char *) xmalloc (system_name_length + 1); | 257 | system_name = (char *) xmalloc (system_name_length + 1); |
| @@ -267,6 +266,7 @@ main (argc, argv) | |||
| 267 | system_name_length *= 2; | 266 | system_name_length *= 2; |
| 268 | } | 267 | } |
| 269 | 268 | ||
| 269 | #ifndef SERVER_HOME_DIR | ||
| 270 | sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); | 270 | sprintf (server.sun_path, "/tmp/esrv%d-%s", geteuid (), system_name); |
| 271 | 271 | ||
| 272 | if (unlink (server.sun_path) == -1 && errno != ENOENT) | 272 | if (unlink (server.sun_path) == -1 && errno != ENOENT) |
| @@ -280,7 +280,6 @@ main (argc, argv) | |||
| 280 | 280 | ||
| 281 | strcpy (server.sun_path, homedir); | 281 | strcpy (server.sun_path, homedir); |
| 282 | strcat (server.sun_path, "/.emacs-server-"); | 282 | strcat (server.sun_path, "/.emacs-server-"); |
| 283 | gethostname (system_name, sizeof (system_name)); | ||
| 284 | strcat (server.sun_path, system_name); | 283 | strcat (server.sun_path, system_name); |
| 285 | /* Delete anyone else's old server. */ | 284 | /* Delete anyone else's old server. */ |
| 286 | unlink (server.sun_path); | 285 | unlink (server.sun_path); |