Permalink
Browse files

listener: fix more unistd.h breakage

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information...
fabbione committed Mar 10, 2013
1 parent 59cb90e commit 2e1049111c297d74a6f4bf888f932af7018e0b71
Showing with 8 additions and 8 deletions.
  1. +8 −8 libknet/listener.c
View
@@ -28,7 +28,7 @@ int _listener_add(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
int value, count = 0;
struct epoll_event ev;
int savederrno = 0, err = 0;
- struct knet_link *link = &knet_h->host_index[host_id]->link[link_id];
+ struct knet_link *lnk = &knet_h->host_index[host_id]->link[link_id];
struct knet_listener *listener = NULL;
savederrno = pthread_rwlock_wrlock(&knet_h->listener_rwlock);
@@ -44,7 +44,7 @@ int _listener_add(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
while (listener) {
count++;
log_debug(knet_h, KNET_SUB_LISTENER, "checking listener: %d", count);
- if (!memcmp(&link->src_addr, &listener->address, sizeof(struct sockaddr_storage))) {
+ if (!memcmp(&lnk->src_addr, &listener->address, sizeof(struct sockaddr_storage))) {
log_debug(knet_h, KNET_SUB_LISTENER, "found active listener");
break;
}
@@ -62,7 +62,7 @@ int _listener_add(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
}
memset(listener, 0, sizeof(struct knet_listener));
- memcpy(&listener->address, &link->src_addr, sizeof(struct sockaddr_storage));
+ memcpy(&listener->address, &lnk->src_addr, sizeof(struct sockaddr_storage));
listener->sock = socket(listener->address.ss_family, SOCK_DGRAM, 0);
if (listener->sock < 0) {
@@ -115,7 +115,7 @@ int _listener_add(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
listener->next = knet_h->listener_head;
knet_h->listener_head = listener;
}
- link->listener_sock = listener->sock;
+ lnk->listener_sock = listener->sock;
exit_unlock:
if ((err) && (listener)) {
@@ -136,7 +136,7 @@ int _listener_remove(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
int link_idx;
struct epoll_event ev; /* kernel < 2.6.9 bug (see epoll_ctl man) */
struct knet_host *host;
- struct knet_link *link = &knet_h->host_index[host_id]->link[link_id];
+ struct knet_link *lnk = &knet_h->host_index[host_id]->link[link_id];
struct knet_listener *tmp_listener;
struct knet_listener *listener;
int listener_cnt = 0;
@@ -155,14 +155,14 @@ int _listener_remove(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
if (host->link[link_idx].status.enabled != 1)
continue;
- if (host->link[link_idx].listener_sock == link->listener_sock) {
+ if (host->link[link_idx].listener_sock == lnk->listener_sock) {
listener_cnt++;
}
}
}
if (listener_cnt) {
- link->listener_sock = 0;
+ lnk->listener_sock = 0;
log_debug(knet_h, KNET_SUB_LISTENER, "listener_remove: listener still in use");
savederrno = EBUSY;
err = -1;
@@ -171,7 +171,7 @@ int _listener_remove(knet_handle_t knet_h, uint16_t host_id, uint8_t link_id)
listener = knet_h->listener_head;
while (listener) {
- if (listener->sock == link->listener_sock)
+ if (listener->sock == lnk->listener_sock)
break;
listener = listener->next;
}

0 comments on commit 2e10491

Please sign in to comment.