[lib] Rename run -> owl_run

This commit is contained in:
Matteo Cypriani 2011-03-29 15:44:37 +02:00
parent 1f37211609
commit d62a7500b1
4 changed files with 19 additions and 18 deletions

View File

@ -9,7 +9,7 @@
#define DEBUG #define DEBUG
owl_bool run = TRUE ; owl_bool owl_run = TRUE ;
@ -448,7 +448,7 @@ void owl_sigint_handler(int num)
exit(ERR_BAD_SIGNAL) ; exit(ERR_BAD_SIGNAL) ;
} }
run = FALSE ; owl_run = FALSE ;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "\nSignal received: end.\n"); fprintf(stderr, "\nSignal received: end.\n");

View File

@ -238,7 +238,8 @@ typedef struct _owl_autocalibration_order
/* Global variables */ /* Global variables */
extern owl_bool run ; // Used to handle end of loops:
extern owl_bool owl_run ;
/* Function error codes */ /* Function error codes */

View File

@ -78,7 +78,7 @@ int main(int argc, char **argv)
} }
} }
run = TRUE ; owl_run = TRUE ;
ret = read_loop(sockfd) ; ret = read_loop(sockfd) ;
/* Wait for the threads to terminate */ /* Wait for the threads to terminate */
@ -387,14 +387,14 @@ int read_loop(int sockfd)
request_time_str[OWL_TIMESTAMP_STR_LEN], request_time_str[OWL_TIMESTAMP_STR_LEN],
start_time_str[OWL_TIMESTAMP_STR_LEN] ; start_time_str[OWL_TIMESTAMP_STR_LEN] ;
while (run) while (owl_run)
{ {
nread = recvfrom(sockfd, &request, sizeof(request), 0, nread = recvfrom(sockfd, &request, sizeof(request), 0,
(struct sockaddr *) &client, &client_len) ; (struct sockaddr *) &client, &client_len) ;
if (nread <= 0) if (nread <= 0)
{ {
if (run) if (owl_run)
{ {
fprintf(stderr, "No request received from client!\n") ; fprintf(stderr, "No request received from client!\n") ;
ret = ERR_NO_MESSAGE_RECEIVED ; ret = ERR_NO_MESSAGE_RECEIVED ;
@ -507,7 +507,7 @@ void* monitor_requests(void *NULL_value)
} }
pthread_cleanup_push(&owl_close_file, &fd) ; pthread_cleanup_push(&owl_close_file, &fd) ;
while (run) while (owl_run)
{ {
request_ptr = requests ; request_ptr = requests ;
request_prev = NULL ; request_prev = NULL ;
@ -829,14 +829,14 @@ void* listen_for_aps(void *NULL_value)
} }
pthread_cleanup_push(&owl_close_fd, &listen_sockfd) ; pthread_cleanup_push(&owl_close_fd, &listen_sockfd) ;
while (run) while (owl_run)
{ {
nread = recvfrom(listen_sockfd, &message, sizeof(message), 0, nread = recvfrom(listen_sockfd, &message, sizeof(message), 0,
(struct sockaddr *) &client, &client_len) ; (struct sockaddr *) &client, &client_len) ;
if (nread <= 0 && run) if (nread <= 0 && owl_run)
{ {
if (run) if (owl_run)
fprintf(stderr, "No message received from listener!\n") ; fprintf(stderr, "No message received from listener!\n") ;
continue ; continue ;
} }
@ -978,7 +978,7 @@ void* monitor_aps(void *NULL_value)
fprintf(stderr, "Monitor AP thread launched.\n") ; fprintf(stderr, "Monitor AP thread launched.\n") ;
#endif // DEBUG #endif // DEBUG
while (run) while (owl_run)
{ {
delete_old_aps() ; delete_old_aps() ;

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[])
program_name = argv[0] ; program_name = argv[0] ;
initialise_configuration(argc, argv) ; initialise_configuration(argc, argv) ;
run = TRUE ; owl_run = TRUE ;
/* Set up signal handlers */ /* Set up signal handlers */
sigemptyset(&action.sa_mask) ; sigemptyset(&action.sa_mask) ;
@ -565,7 +565,7 @@ void* keep_mode_monitor(void *iface)
if (GET_VERBOSE()) if (GET_VERBOSE())
fprintf(stderr, "Thread for keeping monitor mode launched.\n") ; fprintf(stderr, "Thread for keeping monitor mode launched.\n") ;
while (run) while (owl_run)
{ {
// Switch the interface to monitor mode: // Switch the interface to monitor mode:
owl_iface_mode_monitor((char*) iface) ; owl_iface_mode_monitor((char*) iface) ;
@ -601,7 +601,7 @@ int capture()
GET_AGGREGATION_PORT(), GET_AGGREGATION_PORT(),
&aggregation_server, NULL) ; &aggregation_server, NULL) ;
while (run) while (owl_run)
// Capture one packet at time, and call read_packet() on it: // Capture one packet at time, and call read_packet() on it:
pcap_loop(capture_handler, 1, read_packet, NULL) ; pcap_loop(capture_handler, 1, read_packet, NULL) ;
@ -1049,7 +1049,7 @@ void* autocalibrate_hello(void *NULL_value)
memcpy(&message.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ; memcpy(&message.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ;
while (run) while (owl_run)
{ {
owlclient_send_packet(send_sockfd, &serv, owlclient_send_packet(send_sockfd, &serv,
&message, sizeof(message)) ; &message, sizeof(message)) ;
@ -1093,14 +1093,14 @@ void* autocalibrate(void *NULL_value)
} }
pthread_cleanup_push(&owl_close_fd, &listen_sockfd) ; pthread_cleanup_push(&owl_close_fd, &listen_sockfd) ;
while (run) while (owl_run)
{ {
nread = recvfrom(listen_sockfd, &message, sizeof(message), 0, nread = recvfrom(listen_sockfd, &message, sizeof(message), 0,
(struct sockaddr *) &client, &client_len) ; (struct sockaddr *) &client, &client_len) ;
if (nread <= 0 && run) if (nread <= 0 && owl_run)
{ {
if (run) if (owl_run)
fprintf(stderr, "No message received from aggregator!\n") ; fprintf(stderr, "No message received from aggregator!\n") ;
continue ; continue ;
} }