changeset 83135:0c9a34bef526

Fix server-socket-dir initialization (rep. by Friedrich Delgado Friedrichs). lisp/server.el (server-socket-dir): Remove premature initialization. (server-start): Initialize server-socket-dir with the correct uid. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-175
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 25 May 2004 01:18:01 +0000
parents 445e34bd8b61
children 72439f0b5650
files lisp/server.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/server.el	Mon May 24 23:42:52 2004 +0000
+++ b/lisp/server.el	Tue May 25 01:18:01 2004 +0000
@@ -161,8 +161,9 @@
 
 (defvar server-name "server")
 
-(defvar server-socket-dir
-  (format "/tmp/emacs%d" (user-uid)))
+(defvar server-socket-dir nil
+  "The directory in which to place the server socket.
+Initialized by `server-start'.")
 
 (defun server-client (proc)
   "Return the Emacs client corresponding to PROC.
@@ -367,6 +368,9 @@
 
 Prefix arg means just kill any existing server communications subprocess."
   (interactive "P")
+  ;; It is safe to get the user id now.
+  (setq server-socket-dir (or server-socket-dir
+			      (format "/tmp/emacs%d" (user-uid))))
   ;; Make sure there is a safe directory in which to place the socket.
   (server-ensure-safe-dir server-socket-dir)
   ;; kill it dead!