changeset 110833:5481007b7ce9

Close bug#3992. * lib-src/emacsclient.c (set_local_socket) [DARWIN_OS]: Try as a fall-back DARWIN_USER_TEMP_DIR.
author Glenn Morris <rgm@gnu.org>
date Thu, 30 Sep 2010 20:41:12 -0700
parents 0eedefa853ee
children 526c42ed21b1 093225094d08
files lib-src/ChangeLog lib-src/emacsclient.c
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Fri Oct 01 01:05:26 2010 +0200
+++ b/lib-src/ChangeLog	Thu Sep 30 20:41:12 2010 -0700
@@ -1,3 +1,8 @@
+2010-10-01  Glenn Morris  <rgm@gnu.org>
+
+	* emacsclient.c (set_local_socket) [DARWIN_OS]: Try as a fall-back
+	DARWIN_USER_TEMP_DIR.  (Bug#3992)
+
 2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Version 23.2 released.
--- a/lib-src/emacsclient.c	Fri Oct 01 01:05:26 2010 +0200
+++ b/lib-src/emacsclient.c	Thu Sep 30 20:41:12 2010 -0700
@@ -1249,7 +1249,18 @@
       {
 	tmpdir = egetenv ("TMPDIR");
 	if (!tmpdir)
-	  tmpdir = "/tmp";
+          {
+#ifdef DARWIN_OS
+            size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0);
+            if (n > 0)
+              {
+                tmpdir = alloca (n);
+                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
+              }
+            else
+#endif
+              tmpdir = "/tmp";
+          }
 	socket_name = alloca (strlen (tmpdir) + strlen (server_name)
 			      + EXTRA_SPACE);
 	sprintf (socket_name, "%s/emacs%d/%s",