(main): Always use /tmp and non-qualified hostname.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 27 Sep 2002 22:07:38 +0000 (22:07 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 27 Sep 2002 22:07:38 +0000 (22:07 +0000)
lib-src/ChangeLog
lib-src/emacsclient.c

index fd91545..d441bc4 100644 (file)
@@ -6,6 +6,7 @@
        (decode_options): Add -e and -d processing.
        (print_help_and_exit): Update the usage string.
        (main): Add support for --eval and --display.
+       (main): Always use /tmp and non-qualified hostname.
 
 2002-09-25  Stefan Monnier  <monnier@cs.yale.edu>
 
index ac53017..d06334e 100644 (file)
@@ -313,6 +313,7 @@ main (argc, argv)
   server.sun_family = AF_UNIX;
 
   {
+    char *dot;
     system_name_length = 32;
 
     while (1)
@@ -328,9 +329,13 @@ main (argc, argv)
        free (system_name);
        system_name_length *= 2;
       }
+
+    /* We always use the non-dotted host name, for simplicity.  */
+    dot = index (system_name, '.');
+    if (dot)
+      *dot = '\0';
   }
 
-#ifndef SERVER_HOME_DIR
   {
     int sock_status = 0;
 
@@ -387,16 +392,6 @@ main (argc, argv)
         break;
        }
   }
-#else
-  if ((homedir = getenv ("HOME")) == NULL)
-    {
-      fprintf (stderr, "%s: No home directory\n", argv[0]);
-      fail (argc, argv);
-    }
-  strcpy (server.sun_path, homedir);
-  strcat (server.sun_path, "/.emacs-server-");
-  strcat (server.sun_path, system_name);
-#endif
 
   if (connect (s, (struct sockaddr *) &server, strlen (server.sun_path) + 2)
       < 0)