diff options
Diffstat (limited to 'kdecore/kcrash.cpp')
-rw-r--r-- | kdecore/kcrash.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kdecore/kcrash.cpp b/kdecore/kcrash.cpp index 2a908670b..5642500f8 100644 --- a/kdecore/kcrash.cpp +++ b/kdecore/kcrash.cpp @@ -466,7 +466,9 @@ static int openSocket() sock_file[strlen(sock_file)-1] = 0; strncat(sock_file, "/socket-", MAX_SOCK_FILE - strlen(sock_file)); - if (gethostname(sock_file+strlen(sock_file), MAX_SOCK_FILE - strlen(sock_file) - 1) != 0) + if( getenv("XAUTHLOCALHOSTNAME")) + strncat(sock_file, getenv("XAUTHLOCALHOSTNAME"), MAX_SOCK_FILE - strlen(sock_file) - 1); + else if (gethostname(sock_file+strlen(sock_file), MAX_SOCK_FILE - strlen(sock_file) - 1) != 0) { perror("Warning: Could not determine hostname: "); return -1; |