diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-10-18 22:23:18 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-10-19 22:11:46 -0700 |
commit | 38bb715cc1f932a5f48d93dd57f21adaa7f6c321 (patch) | |
tree | 35f8fd60d4437ae7c6e42d022de8d791e9d63db5 /fd.c | |
parent | 747ecb19f89540b60ae340ddc1d176f00ef4c216 (diff) | |
download | xscope-38bb715cc1f932a5f48d93dd57f21adaa7f6c321.tar.gz |
Rename sockaddr_un variable from sun to saun to avoid conflict with #define sun
Compilers auto-define "sun" on Solaris/SunOS, which causes the variable
name to turn into a constant "1", breaking the parsing of the code.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'fd.c')
-rw-r--r-- | fd.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -309,7 +309,7 @@ MakeConnection(const char *server, short port, int report, #else /* !USE_XTRANS */ char HostName[512]; struct sockaddr_in sin; - struct sockaddr_un sun; + struct sockaddr_un saun; struct sockaddr *saddr; int salen; struct hostent *hp; @@ -323,11 +323,11 @@ MakeConnection(const char *server, short port, int report, /* establish a socket to the name server for this host */ /* determine the host machine for this process */ if (*server == '\0') { - sun.sun_family = AF_UNIX; - snprintf(sun.sun_path, sizeof(sun.sun_path), + saun.sun_family = AF_UNIX; + snprintf(saun.sun_path, sizeof(saun.sun_path), "/tmp/.X11-unix/X%d", port - 6000); - salen = sizeof(sun.sun_family) + strlen(sun.sun_path) + 1; - saddr = (struct sockaddr *) &sun; + salen = sizeof(saun.sun_family) + strlen(saun.sun_path) + 1; + saddr = (struct sockaddr *) &saun; } else { debug(4, (stderr, "try to connect on %s\n", server)); |