diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-08 18:33:35 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-08 18:33:35 +0000 |
commit | ab94fd24e4f424f112ae9ca78243292d81126aa1 (patch) | |
tree | 806df876d078c1a89be2d2e1d6ef4863d3a18ace /src | |
parent | 2125c07023c96b86aea8eada679f935ad6946d6e (diff) |
- Removed setup_socket callback
- Removed init_comm() as init_netio() can be called directly
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2631 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/ircd.c | 2 | ||||
-rw-r--r-- | src/s_bsd.c | 25 |
2 files changed, 5 insertions, 22 deletions
@@ -531,7 +531,7 @@ main(int argc, char *argv[]) fdlist_init(); log_set_file(LOG_TYPE_IRCD, 0, logFileName); check_can_use_v6(); - init_comm(); /* This needs to be setup early ! -- adrian */ + init_netio(); /* This needs to be setup early ! -- adrian */ /* Check if there is pidfile and daemon already running */ check_pidfile(pidFileName); diff --git a/src/s_bsd.c b/src/s_bsd.c index 20bef26..89ba44d 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -52,8 +52,6 @@ static const char *comm_err_str[] = { "Comm OK", "Error during bind()", "Error during DNS lookup", "connect timeout", "Error during connect()", "Comm Error" }; -struct Callback *setup_socket_cb = NULL; - static void comm_connect_callback(fde_t *, int); static PF comm_connect_timeout; static void comm_connect_dns_callback(void *, const struct irc_ssaddr *, const char *); @@ -139,10 +137,9 @@ report_error(int level, const char* text, const char* who, int error) * * Set the socket non-blocking, and other wonderful bits. */ -static void * -setup_socket(va_list args) +static void +setup_socket(int fd) { - int fd = va_arg(args, int); int opt = 1; setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); @@ -153,20 +150,6 @@ setup_socket(va_list args) #endif fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); - - return NULL; -} - -/* - * init_comm() - * - * Initializes comm subsystem. - */ -void -init_comm(void) -{ - setup_socket_cb = register_callback("setup_socket", setup_socket); - init_netio(); } /* @@ -712,7 +695,7 @@ comm_open(fde_t *F, int family, int sock_type, int proto, const char *note) if (fd < 0) return -1; /* errno will be passed through, yay.. */ - execute_callback(setup_socket_cb, fd); + setup_socket(fd); /* update things in our fd tracking */ fd_open(F, fd, 1, note); @@ -753,7 +736,7 @@ comm_accept(struct Listener *lptr, struct irc_ssaddr *pn) pn->ss_len = addrlen; #endif - execute_callback(setup_socket_cb, newfd); + setup_socket(newfd); /* .. and return */ return newfd; |