Add the ability to bind listening sockets to addresses, and use this for the
/detach IPC socket. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@330 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -2576,7 +2576,7 @@ static int create_ipc_socket(void)
|
|||||||
|
|
||||||
init_socketpath();
|
init_socketpath();
|
||||||
|
|
||||||
if ((s = connect_by_number(NULL, &port, SERVICE_SERVER, PROTOCOL_TCP, 0)) < 0)
|
if ((s = connect_by_number("127.0.0.1", &port, SERVICE_SERVER, PROTOCOL_TCP, 0)) < 0)
|
||||||
{
|
{
|
||||||
bitchsay("Error creating IPC socket: [%d] %s", s, strerror(errno));
|
bitchsay("Error creating IPC socket: [%d] %s", s, strerror(errno));
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -466,7 +466,11 @@ int BX_connect_by_number(char *hostn, unsigned short *portnum, int service, int
|
|||||||
|
|
||||||
memset(&name, 0, sizeof name);
|
memset(&name, 0, sizeof name);
|
||||||
name.sin_family = AF_INET;
|
name.sin_family = AF_INET;
|
||||||
name.sin_addr.s_addr = htonl(INADDR_ANY);
|
|
||||||
|
if (hostn)
|
||||||
|
inet_aton(hostn, &name.sin_addr);
|
||||||
|
else
|
||||||
|
name.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
|
|
||||||
name.sin_port = htons(*portnum);
|
name.sin_port = htons(*portnum);
|
||||||
#ifdef PARANOID
|
#ifdef PARANOID
|
||||||
|
|||||||
Reference in New Issue
Block a user