[lib] Rename run -> owl_run
This commit is contained in:
parent
1f37211609
commit
d62a7500b1
|
@ -9,7 +9,7 @@
|
|||
#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) ;
|
||||
}
|
||||
|
||||
run = FALSE ;
|
||||
owl_run = FALSE ;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "\nSignal received: end.\n");
|
||||
|
|
|
@ -238,7 +238,8 @@ typedef struct _owl_autocalibration_order
|
|||
|
||||
|
||||
/* Global variables */
|
||||
extern owl_bool run ;
|
||||
// Used to handle end of loops:
|
||||
extern owl_bool owl_run ;
|
||||
|
||||
|
||||
/* Function error codes */
|
||||
|
|
|
@ -78,7 +78,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
run = TRUE ;
|
||||
owl_run = TRUE ;
|
||||
ret = read_loop(sockfd) ;
|
||||
|
||||
/* Wait for the threads to terminate */
|
||||
|
@ -387,14 +387,14 @@ int read_loop(int sockfd)
|
|||
request_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,
|
||||
(struct sockaddr *) &client, &client_len) ;
|
||||
|
||||
if (nread <= 0)
|
||||
{
|
||||
if (run)
|
||||
if (owl_run)
|
||||
{
|
||||
fprintf(stderr, "No request received from client!\n") ;
|
||||
ret = ERR_NO_MESSAGE_RECEIVED ;
|
||||
|
@ -507,7 +507,7 @@ void* monitor_requests(void *NULL_value)
|
|||
}
|
||||
pthread_cleanup_push(&owl_close_file, &fd) ;
|
||||
|
||||
while (run)
|
||||
while (owl_run)
|
||||
{
|
||||
request_ptr = requests ;
|
||||
request_prev = NULL ;
|
||||
|
@ -829,14 +829,14 @@ void* listen_for_aps(void *NULL_value)
|
|||
}
|
||||
pthread_cleanup_push(&owl_close_fd, &listen_sockfd) ;
|
||||
|
||||
while (run)
|
||||
while (owl_run)
|
||||
{
|
||||
nread = recvfrom(listen_sockfd, &message, sizeof(message), 0,
|
||||
(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") ;
|
||||
continue ;
|
||||
}
|
||||
|
@ -978,7 +978,7 @@ void* monitor_aps(void *NULL_value)
|
|||
fprintf(stderr, "Monitor AP thread launched.\n") ;
|
||||
#endif // DEBUG
|
||||
|
||||
while (run)
|
||||
while (owl_run)
|
||||
{
|
||||
delete_old_aps() ;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
|
|||
program_name = argv[0] ;
|
||||
initialise_configuration(argc, argv) ;
|
||||
|
||||
run = TRUE ;
|
||||
owl_run = TRUE ;
|
||||
|
||||
/* Set up signal handlers */
|
||||
sigemptyset(&action.sa_mask) ;
|
||||
|
@ -565,7 +565,7 @@ void* keep_mode_monitor(void *iface)
|
|||
if (GET_VERBOSE())
|
||||
fprintf(stderr, "Thread for keeping monitor mode launched.\n") ;
|
||||
|
||||
while (run)
|
||||
while (owl_run)
|
||||
{
|
||||
// Switch the interface to monitor mode:
|
||||
owl_iface_mode_monitor((char*) iface) ;
|
||||
|
@ -601,7 +601,7 @@ int capture()
|
|||
GET_AGGREGATION_PORT(),
|
||||
&aggregation_server, NULL) ;
|
||||
|
||||
while (run)
|
||||
while (owl_run)
|
||||
// Capture one packet at time, and call read_packet() on it:
|
||||
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) ;
|
||||
|
||||
while (run)
|
||||
while (owl_run)
|
||||
{
|
||||
owlclient_send_packet(send_sockfd, &serv,
|
||||
&message, sizeof(message)) ;
|
||||
|
@ -1093,14 +1093,14 @@ void* autocalibrate(void *NULL_value)
|
|||
}
|
||||
pthread_cleanup_push(&owl_close_fd, &listen_sockfd) ;
|
||||
|
||||
while (run)
|
||||
while (owl_run)
|
||||
{
|
||||
nread = recvfrom(listen_sockfd, &message, sizeof(message), 0,
|
||||
(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") ;
|
||||
continue ;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue