summaryrefslogtreecommitdiffstats
path: root/dcop/dcopc.c
diff options
context:
space:
mode:
Diffstat (limited to 'dcop/dcopc.c')
-rw-r--r--dcop/dcopc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dcop/dcopc.c b/dcop/dcopc.c
index 39083d4f5..9667eb624 100644
--- a/dcop/dcopc.c
+++ b/dcop/dcopc.c
@@ -684,7 +684,9 @@ dcop_connect()
}
hostName[0] = '\0';
- if (gethostname(hostName, sizeof(hostName)))
+ if (getenv("XAUTHLOCALHOSTNAME"))
+ strlcpy(hostName, getenv("XAUTHLOCALHOSTNAME"),sizeof(hostName)-1);
+ else if (gethostname(hostName, sizeof(hostName)))
strcpy(hostName, "localhost");
else
hostName[sizeof(hostName)-1] = '\0';