* lisp/server.el (server-start): Delete the server directory upon
Emacs exit (bug#44644). This fixes the problem of /tmp/emacs0
directories being left behind when running an Emacs server as root.
;; Remove any leftover socket or authentication file.
(ignore-errors
(let (delete-by-moving-to-trash)
- (delete-file server-file)))
+ (delete-file server-file)
+ ;; Also delete the directory that the server file was
+ ;; created in. There may be other servers running,
+ ;; too, so this may fail.
+ (ignore-errors
+ (delete-directory (file-name-directory server-file)))))
(setq server-mode nil) ;; already set by the minor mode code
(display-warning
'server