summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 1991aaa9c02..458519d25fd 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1191,10 +1191,9 @@ set_local_socket (const char *local_socket_name)
{
int sock_status;
- int use_tmpdir = 0;
int saved_errno;
const char *server_name = local_socket_name;
- const char *tmpdir;
+ const char *tmpdir = NULL;
char *tmpdir_storage = NULL;
char *socket_name_storage = NULL;
@@ -1202,7 +1201,6 @@ set_local_socket (const char *local_socket_name)
{
/* socket_name is a file name component. */
long uid = geteuid ();
- use_tmpdir = 1;
tmpdir = egetenv ("TMPDIR");
if (!tmpdir)
{
@@ -1240,7 +1238,7 @@ set_local_socket (const char *local_socket_name)
/* See if the socket exists, and if it's owned by us. */
sock_status = socket_status (server.sun_path);
saved_errno = errno;
- if (sock_status && use_tmpdir)
+ if (sock_status && tmpdir)
{
/* Failing that, see if LOGNAME or USER exist and differ from
our euid. If so, look for a socket based on the UID