luaa: define SUN_LEN if not defined

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-16 15:38:11 +01:00
parent 74cff05428
commit c2765f370e
1 changed files with 5 additions and 0 deletions

5
luaa.c
View File

@ -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)