From 140caffef17f6e5dbd722eb68e8d7dd96cd7a9ba Mon Sep 17 00:00:00 2001
From: Charlie Sharpsteen <source@sharpsteen.net>
Date: Wed, 9 Nov 2011 22:02:12 -0800
Subject: [PATCH 4/4] Protect signals not present on OS X
On OS X, signal.h does not define the following values:
- SIGSTKFLT
- SIGCLD
- SIGPOLL
- SIGPWR
These are now protected by the preprocessor.
---
applications/rasql/rasql_signal.cc | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/applications/rasql/rasql_signal.cc b/applications/rasql/rasql_signal.cc
index b36f0cb..b7b68f4 100644
a
|
b
|
signalHandler(int sig)
|
117 | 117 | break; |
118 | 118 | #ifndef SOLARIS |
119 | 119 | #ifndef DECALPHA |
| 120 | #ifndef __APPLE__ |
120 | 121 | case SIGSTKFLT: |
121 | 122 | cout << "Stack fault."; |
122 | 123 | break; |
123 | 124 | #endif |
124 | 125 | #endif |
125 | | case SIGCLD: |
126 | | cout << "SIGCHLD (System V) or child status has changed (POSIX)."; |
127 | | break; |
| 126 | #endif |
128 | 127 | case SIGCONT: |
129 | 128 | cout << "Continue (POSIX)."; |
130 | 129 | break; |
… |
… |
signalHandler(int sig)
|
158 | 157 | case SIGWINCH: |
159 | 158 | cout << "Window size change (4.3 BSD, Sun). Continuing operation."; |
160 | 159 | break; |
| 160 | #ifndef __APPLE__ |
| 161 | case SIGCLD: |
| 162 | cout << "SIGCHLD (System V) or child status has changed (POSIX)."; |
| 163 | break; |
161 | 164 | case SIGPOLL: |
162 | 165 | cout << "Pollable event occurred (System V) or I/O now possible (4.2 BSD)."; |
163 | 166 | break; |
164 | 167 | case SIGPWR: |
165 | 168 | cout << "Power failure restart (System V)."; |
166 | 169 | break; |
| 170 | #endif |
167 | 171 | case SIGSYS: |
168 | 172 | cout << "Bad system call."; |
169 | 173 | break; |
… |
… |
installSignalHandlers()
|
213 | 217 | signal(SIGTERM, signalHandler); |
214 | 218 | #ifndef SOLARIS |
215 | 219 | #ifndef DECALPHA |
| 220 | #ifndef __APPLE__ |
216 | 221 | signal(SIGSTKFLT, signalHandler); |
217 | 222 | #endif |
218 | 223 | #endif |
219 | | signal(SIGCLD, signalHandler); |
| 224 | #endif |
220 | 225 | signal(SIGCHLD, signalHandler); |
221 | 226 | signal(SIGCONT, signalHandler); |
222 | 227 | signal(SIGSTOP, signalHandler); |
… |
… |
installSignalHandlers()
|
229 | 234 | signal(SIGVTALRM, signalHandler); |
230 | 235 | signal(SIGPROF, signalHandler); |
231 | 236 | signal(SIGWINCH, signalHandler); |
| 237 | #ifndef __APPLE__ |
| 238 | signal(SIGCLD, signalHandler); |
232 | 239 | signal(SIGPOLL, signalHandler); |
233 | | signal(SIGIO, signalHandler); |
234 | 240 | signal(SIGPWR, signalHandler); |
| 241 | #endif |
| 242 | signal(SIGIO, signalHandler); |
235 | 243 | signal(SIGSYS, signalHandler); |
236 | 244 | #if !defined SOLARIS |
237 | 245 | #if !defined DECALPHA |
| 246 | #ifndef __APPLE__ |
238 | 247 | signal(SIGUNUSED, signalHandler); |
239 | 248 | #endif |
240 | 249 | #endif |
| 250 | #endif |
241 | 251 | LEAVE( "installSignalHandlers" ); |
242 | 252 | } |
243 | 253 | |