diff options
Diffstat (limited to 'opentracker.c')
| -rw-r--r-- | opentracker.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/opentracker.c b/opentracker.c index ab4a934..e0f16d7 100644 --- a/opentracker.c +++ b/opentracker.c | |||
| @@ -49,7 +49,9 @@ static void panic(const char *routine) { | |||
| 49 | exit(111); | 49 | exit(111); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | /* Say we are stopping, wake the loop, and let main do the work on its own stack. */ | 52 | /* Say we are stopping, wake the loop, and let main do the work on its own |
| 53 | stack. Everything other than SIGINT falls through and does nothing, which | ||
| 54 | is what OT_SIGNAL_WAKE wants: returning from the read is all it is for. */ | ||
| 53 | static void signal_handler(int s) { | 55 | static void signal_handler(int s) { |
| 54 | if (s == SIGINT) { | 56 | if (s == SIGINT) { |
| 55 | const char byte = 0; | 57 | const char byte = 0; |
| @@ -85,7 +87,8 @@ static void install_signal_handlers(void) { | |||
| 85 | sa.sa_handler = signal_handler; | 87 | sa.sa_handler = signal_handler; |
| 86 | sigemptyset(&sa.sa_mask); | 88 | sigemptyset(&sa.sa_mask); |
| 87 | sa.sa_flags = 0; | 89 | sa.sa_flags = 0; |
| 88 | if ((sigaction(SIGINT, &sa, NULL) == -1) || (sigaction(SIGALRM, &sa, NULL) == -1)) | 90 | if ((sigaction(SIGINT, &sa, NULL) == -1) || (sigaction(SIGALRM, &sa, NULL) == -1) || |
| 91 | (sigaction(OT_SIGNAL_WAKE, &sa, NULL) == -1)) | ||
| 89 | panic("install_signal_handlers"); | 92 | panic("install_signal_handlers"); |
| 90 | 93 | ||
| 91 | sigaddset(&signal_mask, SIGINT); | 94 | sigaddset(&signal_mask, SIGINT); |
