mirror of
https://github.com/0intro/wmii
synced 2025-01-12 21:29:19 +03:00
applied John-Galt's patch of libixp/socket.c
This commit is contained in:
parent
b04617dae9
commit
0115b00394
@ -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:
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user