summaryrefslogtreecommitdiff
path: root/src/tools/cbr/cbr_server.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-08-04 18:08:32 +0200
committerSander Vrijders <[email protected]>2016-08-04 18:08:32 +0200
commitd5b71449bc18116444720257ba640e3c597ff6e9 (patch)
treee2fca06805ca406607402c7206ea14ae17611d82 /src/tools/cbr/cbr_server.c
parent51bb7c6f315dba4044eb2ece5c1312362674d7fb (diff)
parent25c356b9ba9d91b4a291e3adad050d8ea85eb3e2 (diff)
downloadouroboros-d5b71449bc18116444720257ba640e3c597ff6e9.tar.gz
ouroboros-d5b71449bc18116444720257ba640e3c597ff6e9.zip
Merged in dstaesse/ouroboros/be-bugfixing (pull request #186)
Be bugfixing
Diffstat (limited to 'src/tools/cbr/cbr_server.c')
-rw-r--r--src/tools/cbr/cbr_server.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/cbr/cbr_server.c b/src/tools/cbr/cbr_server.c
index 9c6ac7f1..1890c842 100644
--- a/src/tools/cbr/cbr_server.c
+++ b/src/tools/cbr/cbr_server.c
@@ -24,7 +24,7 @@
#include <stdbool.h>
#ifdef __FreeBSD__
-#define __XSI_VISIBLE
+#define __XSI_VISIBLE 500
#endif
#include <signal.h>
@@ -112,13 +112,13 @@ void handle_flow(int fd)
printf("Flow %4d: %9ld SDUs (%12ld bytes) in %9ld ms"
" => %9.4f p/s, %9.4f Mb/s\n",
fd,
- sdus-sdus_intv,
- bytes_read-bytes_read_intv,
+ sdus - sdus_intv,
+ bytes_read - bytes_read_intv,
us / 1000,
- ((sdus-sdus_intv) / (float) us) * MILLION,
- 8 * (bytes_read-bytes_read_intv)
+ ((sdus - sdus_intv) / (float) us) * MILLION,
+ 8 * (bytes_read - bytes_read_intv)
/ (float)(us));
- iv_start=iv_end;
+ iv_start = iv_end;
sdus_intv = sdus;
bytes_read_intv = bytes_read;
ts_add(&iv_start, &intv, &iv_end);
@@ -134,13 +134,13 @@ void * worker(void * o)
pthread_mutex_lock(&fds_lock);
pthread_cleanup_push((void(*)(void *)) pthread_mutex_unlock,
(void *) &fds_lock);
- while (fds[fds_index] == -1) {
+ while (fds[fds_index] == -1)
pthread_cond_wait(&fds_signal, &fds_lock);
- }
cli_fd = fds[fds_index];
fds[fds_index] = -1;
- pthread_cleanup_pop(1);
+
+ pthread_cleanup_pop(true);
handle_flow(cli_fd);