Don't delete socket on server exit if it was passed in

* lisp/server.el (server-sentinel): Don't delete the socket if it
was passed in to Emacs (bug#47511).
This commit is contained in:
Lars Ingebrigtsen 2021-05-08 14:22:30 +02:00
parent 12a37ef6d2
commit 53dfb51f55

View file

@ -413,9 +413,14 @@ If CLIENT is non-nil, add a description of it to the logged message."
;; for possible servers before doing anything, so it *should* be ours.
(and (process-contact proc :server)
(eq (process-status proc) 'closed)
;; If this variable is non-nil, the socket was passed in to
;; Emacs, and not created by Emacs itself (for instance,
;; created by systemd). In that case, don't delete the socket.
(not internal--daemon-sockname)
(ignore-errors
(delete-file (process-get proc :server-file))))
(server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
(server-log (format "Status changed to %s: %s"
(process-status proc) msg) proc)
(server-delete-client proc))
(defun server--on-display-p (frame display)