Commit 14f67fa6 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(server-start): Try both full hostname and shortened

hostname when deleting the socket file.
parent d1c1c3d2
......@@ -147,9 +147,18 @@ Prefix arg means just kill any existing server communications subprocess."
(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))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment