diff options
| -rw-r--r-- | lib-src/emacsclient.c | 6 |
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) | |||
| 1191 | 1191 | ||
| 1192 | { | 1192 | { |
| 1193 | int sock_status; | 1193 | int sock_status; |
| 1194 | int use_tmpdir = 0; | ||
| 1195 | int saved_errno; | 1194 | int saved_errno; |
| 1196 | const char *server_name = local_socket_name; | 1195 | const char *server_name = local_socket_name; |
| 1197 | const char *tmpdir; | 1196 | const char *tmpdir = NULL; |
| 1198 | char *tmpdir_storage = NULL; | 1197 | char *tmpdir_storage = NULL; |
| 1199 | char *socket_name_storage = NULL; | 1198 | char *socket_name_storage = NULL; |
| 1200 | 1199 | ||
| @@ -1202,7 +1201,6 @@ set_local_socket (const char *local_socket_name) | |||
| 1202 | { | 1201 | { |
| 1203 | /* socket_name is a file name component. */ | 1202 | /* socket_name is a file name component. */ |
| 1204 | long uid = geteuid (); | 1203 | long uid = geteuid (); |
| 1205 | use_tmpdir = 1; | ||
| 1206 | tmpdir = egetenv ("TMPDIR"); | 1204 | tmpdir = egetenv ("TMPDIR"); |
| 1207 | if (!tmpdir) | 1205 | if (!tmpdir) |
| 1208 | { | 1206 | { |
| @@ -1240,7 +1238,7 @@ set_local_socket (const char *local_socket_name) | |||
| 1240 | /* See if the socket exists, and if it's owned by us. */ | 1238 | /* See if the socket exists, and if it's owned by us. */ |
| 1241 | sock_status = socket_status (server.sun_path); | 1239 | sock_status = socket_status (server.sun_path); |
| 1242 | saved_errno = errno; | 1240 | saved_errno = errno; |
| 1243 | if (sock_status && use_tmpdir) | 1241 | if (sock_status && tmpdir) |
| 1244 | { | 1242 | { |
| 1245 | /* Failing that, see if LOGNAME or USER exist and differ from | 1243 | /* Failing that, see if LOGNAME or USER exist and differ from |
| 1246 | our euid. If so, look for a socket based on the UID | 1244 | our euid. If so, look for a socket based on the UID |