From c2765f370e3c8e7b17673a62a1adcb52c85649d4 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 16 Jan 2009 15:38:11 +0100 Subject: [PATCH] luaa: define SUN_LEN if not defined Signed-off-by: Julien Danjou --- luaa.c | 5 +++++ 1 file changed, 5 insertions(+) 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)