diff --git a/TODO.wmii-4 b/TODO.wmii-4 index a84cd483..7f8cb756 100644 --- a/TODO.wmii-4 +++ b/TODO.wmii-4 @@ -1,3 +1,4 @@ +- remove snap-to-border for managed windows (is pointless). - UTF8 fixes with iconv? - re-introduce mouse based resizals (titlebar and border) - idea for column mode: diff --git a/libixp/socket.c b/libixp/socket.c index d7f21df0..b29399e1 100644 --- a/libixp/socket.c +++ b/libixp/socket.c @@ -107,6 +107,7 @@ create_inet_sock(char *host, char **errstr) { int fd; struct sockaddr_in addr = { 0 }; + struct hostent *hp; char *port = strrchr(host, '!'); unsigned int prt; @@ -125,9 +126,17 @@ create_inet_sock(char *host, char **errstr) return -1; } addr.sin_family = AF_INET; - addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(prt); + if(!strncmp(host, "*", 1)) + addr.sin_addr.s_addr = htonl(INADDR_ANY); + else if((hp = gethostbyname(host))) + bcopy(hp->h_addr, &addr.sin_addr, hp->h_length); + else { + *errstr = "cannot translate hostname to an address"; + return -1; + } + if(bind(fd, (struct sockaddr *) &addr, sizeof(struct sockaddr_in)) < 0) { *errstr = "cannot bind socket"; close(fd);