From 59e1cf5becda80d2cb99ff980332863e458cfa66 Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Wed, 19 Dec 2012 15:14:52 +0100 Subject: [PATCH] Make define name clear Signed-off-by: Fabio M. Di Nitto --- libknet/handle.c | 6 +++--- libknet/threads.c | 12 ++++++------ libknet/threads.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libknet/handle.c b/libknet/handle.c index eddcef1fa..0ef032c98 100644 --- a/libknet/handle.c +++ b/libknet/handle.c @@ -106,9 +106,9 @@ knet_handle_t knet_handle_new(uint16_t host_id, goto exit_fail5; } - knet_h->tap_to_links_epollfd = epoll_create(KNET_MAX_EVENTS); - knet_h->recv_from_links_epollfd = epoll_create(KNET_MAX_EVENTS); - knet_h->dst_link_handler_epollfd = epoll_create(KNET_MAX_EVENTS); + knet_h->tap_to_links_epollfd = epoll_create(KNET_EPOLL_MAX_EVENTS); + knet_h->recv_from_links_epollfd = epoll_create(KNET_EPOLL_MAX_EVENTS); + knet_h->dst_link_handler_epollfd = epoll_create(KNET_EPOLL_MAX_EVENTS); if ((knet_h->tap_to_links_epollfd < 0) || (knet_h->recv_from_links_epollfd < 0) || diff --git a/libknet/threads.c b/libknet/threads.c index 28e236caf..41525c714 100644 --- a/libknet/threads.c +++ b/libknet/threads.c @@ -632,7 +632,7 @@ void *_handle_heartbt_thread(void *data) void *_handle_tap_to_links_thread(void *data) { knet_handle_t knet_h = (knet_handle_t) data; - struct epoll_event events[KNET_MAX_EVENTS]; + struct epoll_event events[KNET_EPOLL_MAX_EVENTS]; int i, nev; /* preparing data buffer */ @@ -640,7 +640,7 @@ void *_handle_tap_to_links_thread(void *data) knet_h->tap_to_links_buf->kf_node = htons(knet_h->host_id); while (1) { - nev = epoll_wait(knet_h->tap_to_links_epollfd, events, KNET_MAX_EVENTS, -1); + nev = epoll_wait(knet_h->tap_to_links_epollfd, events, KNET_EPOLL_MAX_EVENTS, -1); for (i = 0; i < nev; i++) { if (events[i].data.fd == knet_h->sockfd) { @@ -660,10 +660,10 @@ void *_handle_recv_from_links_thread(void *data) { int i, nev; knet_handle_t knet_h = (knet_handle_t) data; - struct epoll_event events[KNET_MAX_EVENTS]; + struct epoll_event events[KNET_EPOLL_MAX_EVENTS]; while (1) { - nev = epoll_wait(knet_h->recv_from_links_epollfd, events, KNET_MAX_EVENTS, -1); + nev = epoll_wait(knet_h->recv_from_links_epollfd, events, KNET_EPOLL_MAX_EVENTS, -1); for (i = 0; i < nev; i++) { _handle_recv_from_links(knet_h, events[i].data.fd); @@ -676,10 +676,10 @@ void *_handle_recv_from_links_thread(void *data) void *_handle_dst_link_handler_thread(void *data) { knet_handle_t knet_h = (knet_handle_t) data; - struct epoll_event events[KNET_MAX_EVENTS]; + struct epoll_event events[KNET_EPOLL_MAX_EVENTS]; while (1) { - if (epoll_wait(knet_h->dst_link_handler_epollfd, events, KNET_MAX_EVENTS, -1) >= 1) + if (epoll_wait(knet_h->dst_link_handler_epollfd, events, KNET_EPOLL_MAX_EVENTS, -1) >= 1) _handle_dst_link_updates(knet_h); } diff --git a/libknet/threads.h b/libknet/threads.h index d9f64558a..98b401371 100644 --- a/libknet/threads.h +++ b/libknet/threads.h @@ -10,7 +10,7 @@ #ifndef __THREADS_H__ #define __THREADS_H__ -#define KNET_MAX_EVENTS 8 +#define KNET_EPOLL_MAX_EVENTS 8 void *_handle_tap_to_links_thread(void *data); void *_handle_recv_from_links_thread(void *data);