Subject: /tmp/emacs0/ not cleaned up upon exit

From: 積丹尼 Dan Jacobson <[email-masked]>
Date: Sun, 15 Nov 2020 03:47:42 +0800

Empty server-socket-dir /tmp/emacs0/ left on disk after exit when root.
# id
uid=0(root) gid=0(root) groups=0(root)
# emacs -Q -f server-start
^X^C
# ls -dl /tmp/emacs0/
drwx------ 2 root root 40 11-15 03:26 /tmp/emacs0/

See server.el: server-socket-dir is usually /run/user/nnn/emacs, except
when root, due to server-ensure-safe-dir .

Anyway leaving empty directories around after exit is bad when not root too.

emacs-version "27.1"