Get rid of the event_base_set() calls.

This commit is contained in:
Jan Vidar Krey 2009-08-04 00:13:59 +02:00
parent 604c2d8836
commit 80dee0c020
4 changed files with 0 additions and 6 deletions

View File

@ -543,7 +543,6 @@ struct hub_info* hub_start_service(struct hub_config* config)
} }
event_set(&hub->ev_accept, hub->fd_tcp, EV_READ | EV_PERSIST, net_on_accept, hub); event_set(&hub->ev_accept, hub->fd_tcp, EV_READ | EV_PERSIST, net_on_accept, hub);
event_base_set(net_get_evbase(), &hub->ev_accept);
if (event_add(&hub->ev_accept, NULL) == -1) if (event_add(&hub->ev_accept, NULL) == -1)
{ {
uman_shutdown(hub); uman_shutdown(hub);

View File

@ -81,7 +81,6 @@ void setup_signal_handlers(struct hub_info* hub)
for (i = 0; signals[i]; i++) for (i = 0; signals[i]; i++)
{ {
signal_set(&signal_events[i], signals[i], hub_handle_signal, hub); signal_set(&signal_events[i], signals[i], hub_handle_signal, hub);
event_base_set(net_get_evbase(), &signal_events[i]);
if (signal_add(&signal_events[i], NULL)) if (signal_add(&signal_events[i], NULL))
{ {
LOG_ERROR("Error setting signal handler %d", signals[i]); LOG_ERROR("Error setting signal handler %d", signals[i]);

View File

@ -77,7 +77,6 @@ static void timer_statistics(int fd, short ev, void *arg)
struct timeval timeout = { TIMEOUT_STATS, 0 }; struct timeval timeout = { TIMEOUT_STATS, 0 };
uman_update_stats(hub); uman_update_stats(hub);
evtimer_set(&hub->ev_timer, timer_statistics, hub); evtimer_set(&hub->ev_timer, timer_statistics, hub);
event_base_set(net_get_evbase(), &hub->ev_timer);
evtimer_add(&hub->ev_timer, &timeout); evtimer_add(&hub->ev_timer, &timeout);
} }
#endif #endif
@ -111,7 +110,6 @@ int uman_init(struct hub_info* hub)
if (net_get_evbase()) if (net_get_evbase())
{ {
evtimer_set(&hub->ev_timer, timer_statistics, hub); evtimer_set(&hub->ev_timer, timer_statistics, hub);
event_base_set(net_get_evbase(), &hub->ev_timer);
evtimer_add(&hub->ev_timer, &timeout); evtimer_add(&hub->ev_timer, &timeout);
} }
#endif // 0 #endif // 0

View File

@ -107,7 +107,6 @@ void net_con_initialize(struct net_connection* con, int sd, struct ip_addr_encap
if (events & EV_WRITE) net_con_flag_set(con, NET_WANT_WRITE); if (events & EV_WRITE) net_con_flag_set(con, NET_WANT_WRITE);
event_set(&con->event, con->sd, events | EV_PERSIST, net_con_event, con); event_set(&con->event, con->sd, events | EV_PERSIST, net_con_event, con);
event_base_set(net_get_evbase(), &con->event);
event_add(&con->event, 0); event_add(&con->event, 0);
net_set_nonblocking(sd, 1); net_set_nonblocking(sd, 1);
@ -294,7 +293,6 @@ void net_con_set_timeout(struct net_connection* con, int seconds)
{ {
struct timeval timeout = { seconds, 0 }; struct timeval timeout = { seconds, 0 };
evtimer_set(&con->timeout, net_con_event, con); evtimer_set(&con->timeout, net_con_event, con);
event_base_set(net_get_evbase(), &con->timeout);
evtimer_add(&con->timeout, &timeout); evtimer_add(&con->timeout, &timeout);
} }