awesome: define SUN_LEN if not already defined

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-16 15:35:19 +01:00
parent cdd673f6f4
commit b3c71a87e4
1 changed files with 5 additions and 0 deletions

View File

@ -338,6 +338,11 @@ main(int argc, char *argv[])
csfd = socket_getclient();
addr = socket_getaddr(getenv("DISPLAY"));
/* Needed for some 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)