mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
[master] catch SIGHUP correctly in nothreads
This commit is contained in:
@@ -181,14 +181,12 @@ exit_action(int arg) {
|
|||||||
isc_g_appctx.want_shutdown = ISC_TRUE;
|
isc_g_appctx.want_shutdown = ISC_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ISC_PLATFORM_USETHREADS
|
|
||||||
static void
|
static void
|
||||||
reload_action(int arg) {
|
reload_action(int arg) {
|
||||||
UNUSED(arg);
|
UNUSED(arg);
|
||||||
isc_g_appctx.want_reload = ISC_TRUE;
|
isc_g_appctx.want_reload = ISC_TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
handle_signal(int sig, void (*handler)(int)) {
|
handle_signal(int sig, void (*handler)(int)) {
|
||||||
@@ -256,11 +254,11 @@ isc__app_ctxstart(isc_appctx_t *ctx0) {
|
|||||||
result = isc_mutex_init(&ctx->lock);
|
result = isc_mutex_init(&ctx->lock);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
goto cleanup_rcond;
|
goto cleanup_rcond;
|
||||||
#else
|
#else /* ISC_PLATFORM_USETHREADS */
|
||||||
result = isc_mutex_init(&ctx->lock);
|
result = isc_mutex_init(&ctx->lock);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
#endif
|
#endif /* ISC_PLATFORM_USETHREADS */
|
||||||
|
|
||||||
ISC_LIST_INIT(ctx->on_run);
|
ISC_LIST_INIT(ctx->on_run);
|
||||||
|
|
||||||
@@ -616,6 +614,12 @@ isc__app_ctxrun(isc_appctx_t *ctx0) {
|
|||||||
UNLOCK(&ctx->lock);
|
UNLOCK(&ctx->lock);
|
||||||
|
|
||||||
#ifndef ISC_PLATFORM_USETHREADS
|
#ifndef ISC_PLATFORM_USETHREADS
|
||||||
|
if (isc_bind9 && ctx == &isc_g_appctx) {
|
||||||
|
result = handle_signal(SIGHUP, reload_action);
|
||||||
|
if (result != ISC_R_SUCCESS)
|
||||||
|
return (ISC_R_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
(void) isc__taskmgr_dispatch(ctx->taskmgr);
|
(void) isc__taskmgr_dispatch(ctx->taskmgr);
|
||||||
result = evloop(ctx);
|
result = evloop(ctx);
|
||||||
return (result);
|
return (result);
|
||||||
|
Reference in New Issue
Block a user