We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91a0ad2 commit 9f2d3b3Copy full SHA for 9f2d3b3
src/ngx_http_lua_worker.c
@@ -190,4 +190,36 @@ ngx_http_lua_ffi_process_signal_graceful_exit(void)
190
{
191
ngx_quit = 1;
192
}
193
+
194
195
+int
196
+ngx_http_lua_ffi_enable_sa_restart(int signum, int enabled)
197
+{
198
+#if !(NGX_WIN32)
199
+ struct sigaction act;
200
201
+ if (ngx_process != NGX_PROCESS_WORKER
202
+ && ngx_process != NGX_PROCESS_SINGLE)
203
+ {
204
+ return NGX_DECLINED;
205
+ }
206
207
+ if (sigaction(signum, NULL, &act) != 0) {
208
+ return NGX_ERROR;
209
210
211
+ if (enabled) {
212
+ act.sa_flags |= SA_RESTART;
213
214
+ } else {
215
+ act.sa_flags &= ~SA_RESTART;
216
217
218
+ if (sigaction(signum, &act, NULL) != 0) {
219
220
221
+#endif
222
223
+ return NGX_OK;
224
+}
225
#endif
0 commit comments