Skip to content

Commit

Permalink
Fix Peter's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nomis52 committed Dec 12, 2014
1 parent ca83282 commit 441b847
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/ola-uni-stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,12 @@ void UniverseTracker::RegisterComplete(const string &error) {

SelectServer *ss = NULL;

static void InteruptSignal(OLA_UNUSED int sig) {
static void InteruptSignal(OLA_UNUSED int signo) {
int old_errno = errno;
if (ss) {
ss->Terminate();
}
errno = old_errno;
}


Expand Down
5 changes: 4 additions & 1 deletion tools/e133/basic-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* I'm using this for scale testing.
*/

#include <errno.h>
#include <ola/Callback.h>
#include <ola/Clock.h>
#include <ola/Constants.h>
Expand Down Expand Up @@ -293,10 +294,12 @@ void SimpleE133Controller::SocketClosed(IPV4SocketAddress peer) {
/**
* Interupt handler
*/
static void InteruptSignal(OLA_UNUSED int unused) {
static void InteruptSignal(OLA_UNUSED int signo) {
int old_errno = errno;
if (controller) {
controller->Stop();
}
errno = old_errno;
}

int main(int argc, char *argv[]) {
Expand Down
5 changes: 4 additions & 1 deletion tools/e133/basic-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* I'm using this for scale testing.
*/

#include <errno.h>
#include <ola/Callback.h>
#include <ola/Clock.h>
#include <ola/Constants.h>
Expand Down Expand Up @@ -185,10 +186,12 @@ SimpleE133Device *device = NULL;
/**
* Interupt handler
*/
static void InteruptSignal(OLA_UNUSED int unused) {
static void InteruptSignal(OLA_UNUSED int signo) {
int old_errno = errno;
if (device) {
device->Stop();
}
errno = old_errno;
}

int main(int argc, char *argv[]) {
Expand Down
3 changes: 3 additions & 0 deletions tools/e133/e133-receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <config.h>
#endif

#include <errno.h>
#include <signal.h>

#include <ola/acn/ACNPort.h>
Expand Down Expand Up @@ -84,9 +85,11 @@ SimpleE133Node *simple_node;
* Terminate cleanly on interrupt.
*/
static void InteruptSignal(OLA_UNUSED int signo) {
int old_errno = errno;
if (simple_node) {
simple_node->Stop();
}
errno = old_errno;
}

void HandleTriDMX(DmxBuffer *buffer, DmxTriWidget *widget) {
Expand Down
2 changes: 2 additions & 0 deletions tools/ola_trigger/ola-trigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ static void CatchSIGCHLD(OLA_UNUSED int signo) {
static void CatchSIGINT(OLA_UNUSED int signo) {
// there is a race condition here if you send the signal before we call Run()
// it's not a huge deal though.
int old_errno = errno;
if (ss) {
ss->Terminate();
}
errno = old_errno;
}


Expand Down

0 comments on commit 441b847

Please sign in to comment.