diff options
author | Sander Vrijders <[email protected]> | 2016-10-22 11:33:20 +0000 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-10-22 11:33:20 +0000 |
commit | 727efbe0c5e61862a870c71a2857b28eece3d369 (patch) | |
tree | 881da180b8d801c38ba0fbad2fc9f387a70ec016 /src/tools/cbr/cbr_server.c | |
parent | 482c44232d4deda3f89a7d85fbad99c1c64e80ec (diff) | |
parent | 3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2 (diff) | |
download | ouroboros-727efbe0c5e61862a870c71a2857b28eece3d369.tar.gz ouroboros-727efbe0c5e61862a870c71a2857b28eece3d369.zip |
Merged in dstaesse/ouroboros/be-extra (pull request #268)
build: Comply with -Wextra compiler flag
Diffstat (limited to 'src/tools/cbr/cbr_server.c')
-rw-r--r-- | src/tools/cbr/cbr_server.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/tools/cbr/cbr_server.c b/src/tools/cbr/cbr_server.c index c5664d8b..f1c342d1 100644 --- a/src/tools/cbr/cbr_server.c +++ b/src/tools/cbr/cbr_server.c @@ -48,6 +48,9 @@ pthread_cond_t fds_signal; void shutdown_server(int signo, siginfo_t * info, void * c) { + (void) info; + (void) c; + switch(signo) { case SIGINT: case SIGTERM: @@ -60,7 +63,7 @@ void shutdown_server(int signo, siginfo_t * info, void * c) void handle_flow(int fd) { - ssize_t count = 0; + int count = 0; char buf[BUF_SIZE]; struct timespec now; @@ -109,9 +112,9 @@ void handle_flow(int fd) sdus - sdus_intv, bytes_read - bytes_read_intv, us / 1000, - ((sdus - sdus_intv) / (float) us) * MILLION, + ((sdus - sdus_intv) / (double) us) * MILLION, 8 * (bytes_read - bytes_read_intv) - / (float)(us)); + / (double)(us)); iv_start = iv_end; sdus_intv = sdus; bytes_read_intv = bytes_read; @@ -124,6 +127,8 @@ void * worker(void * o) { int cli_fd; + (void) o; + while (true) { pthread_mutex_lock(&fds_lock); pthread_cleanup_push((void(*)(void *)) pthread_mutex_unlock, @@ -151,6 +156,8 @@ void * listener(void * o) int client_fd = 0; int response = 0; + (void) o; + printf("Server started, interval is %ld s, timeout is %ld s.\n", server_settings.interval, server_settings.timeout); @@ -190,7 +197,7 @@ void * listener(void * o) return 0; } -int server_main() +int server_main(void) { struct sigaction sig_act; int i; |