diff --git a/luaa.c b/luaa.c index c287d1a2e..6a83ec062 100644 --- a/luaa.c +++ b/luaa.c @@ -1219,6 +1219,11 @@ luaA_cs_init(void) addr = socket_getaddr(getenv("DISPLAY")); +/* Needed for some OSes like Solaris */ +#ifndef SUN_LEN +#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path)) +#endif + if(bind(csfd, (const struct sockaddr *) addr, SUN_LEN(addr))) { if(errno == EADDRINUSE)