diff options
Diffstat (limited to 'broccoli/src')
-rw-r--r-- | broccoli/src/broevent.c | 7 | ||||
-rw-r--r-- | broccoli/src/fifoqueue.c | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/broccoli/src/broevent.c b/broccoli/src/broevent.c index 8a74881..206ce17 100644 --- a/broccoli/src/broevent.c +++ b/broccoli/src/broevent.c @@ -26,12 +26,15 @@ pasad_register_received(BroConn *conn, void *data, BroRecord *record) // TODO: handle error return; } - + #ifdef DEBUG printf("Received value %"PRIu64" from uid=%"PRIu64"\n",*value,*address); + #endif add_to_queue(q, create_sensor_object(*value, *address)); + #ifdef DEBUG printf("Added to queue.\n"); + #endif } void * @@ -71,7 +74,7 @@ bro_event_listener(void * args) FD_ZERO(&rfds); FD_SET(fd,&rfds); if(select(fd+1,&rfds,NULL,NULL,NULL) == -1){ - perror("select()"); + printf("select(): Bad file descriptor"); break; } diff --git a/broccoli/src/fifoqueue.c b/broccoli/src/fifoqueue.c index 7e30e37..aeeced9 100644 --- a/broccoli/src/fifoqueue.c +++ b/broccoli/src/fifoqueue.c @@ -67,7 +67,9 @@ pop_from_queue(Fifo_q * q) { int semStat; if(is_empty(q)){ + #ifdef DEBUG printf("Waiting for sensor data\n"); + #endif sem_wait(&q->bufferEmptyBlock); } sem_wait(&q->lock); |