changeset 13157:31242cebf1d3

(server-start): Try both full hostname and shortened hostname when deleting the socket file.
author Richard M. Stallman <rms@gnu.org>
date Sun, 08 Oct 1995 19:42:11 +0000
parents a398dbd2b945
children 02b3310fc081
files lisp/server.el
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/server.el	Sun Oct 08 19:38:53 1995 +0000
+++ b/lisp/server.el	Sun Oct 08 19:42:11 1995 +0000
@@ -147,9 +147,18 @@
 	(set-process-sentinel server-process nil)
 	(condition-case () (delete-process server-process) (error nil))))
   (condition-case () (delete-file "~/.emacs_server") (error nil))
-  (condition-case ()
-      (delete-file (format "/tmp/esrv%d-%s" (user-uid) (system-name)))
-    (error nil))
+  (let* ((sysname (system-name))
+	 (dot-index (string-match "\\." sysname)))
+    (condition-case ()
+	(delete-file (format "/tmp/esrv%d-%s" (user-uid) sysname))
+      (error nil))
+    ;; In case the server file name was made with a domainless hostname,
+    ;; try deleting that name too.
+    (if dot-index
+	(condition-case ()
+	    (delete-file (format "/tmp/esrv%d-%s" (user-uid)
+				 (substring sysname 0 dot-index)))
+	  (error nil))))
   ;; If we already had a server, clear out associated status.
   (while server-clients
     (let ((buffer (nth 1 (car server-clients))))