Commit c80e25e4 authored by Witold Krecicki's avatar Witold Krecicki
Browse files

Get rid of isc_taskmgr_setmode, we only use it to set privileged mode

parent 64020dd7
......@@ -9327,8 +9327,7 @@ load_zones(named_server_t *server, bool init, bool reconfig) {
* the initial server setup; it isn't necessary during
* a reload.)
*/
isc_taskmgr_setmode(named_g_taskmgr,
isc_taskmgrmode_privileged);
isc_taskmgr_setprivilegedmode(named_g_taskmgr);
}
isc_task_endexclusive(server->task);
......
......@@ -672,7 +672,7 @@ isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
*/
void
isc_taskmgr_setmode(isc_taskmgr_t *manager, isc_taskmgrmode_t mode);
isc_taskmgr_setprivilegedmode(isc_taskmgr_t *manager);
isc_taskmgrmode_t
isc_taskmgr_mode(isc_taskmgr_t *manager);
......
......@@ -1450,11 +1450,11 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) {
}
void
isc_taskmgr_setmode(isc_taskmgr_t *manager0, isc_taskmgrmode_t mode) {
isc_taskmgr_setprivilegedmode(isc_taskmgr_t *manager0) {
isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
LOCK(&manager->lock);
manager->mode = mode;
manager->mode = isc_taskmgrmode_privileged;
UNLOCK(&manager->lock);
}
......
......@@ -67,7 +67,6 @@ set_and_drop(isc_task_t *task, isc_event_t *event) {
*value = (int) isc_taskmgr_mode(taskmgr);
counter++;
UNLOCK(&lock);
isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_normal);
}
/*
......@@ -230,7 +229,7 @@ ATF_TC_BODY(privileged_events, tc) {
isc_task_send(task2, &event);
ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal);
isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged);
isc_taskmgr_setprivilegedmode(taskmgr);
ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged);
isc__taskmgr_resume(taskmgr);
......@@ -351,7 +350,7 @@ ATF_TC_BODY(privilege_drop, tc) {
isc_task_send(task2, &event);
ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal);
isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged);
isc_taskmgr_setprivilegedmode(taskmgr);
ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged);
isc__taskmgr_resume(taskmgr);
......@@ -363,14 +362,12 @@ ATF_TC_BODY(privilege_drop, tc) {
}
/*
* We can't guarantee what order the events fire, but
* we do know *exactly one* of the privileged tasks will
* have run in privileged mode...
* We need to check that all privilege mode events were fired
* in privileged mode, and non privileged in non-privileged.
*/
ATF_CHECK(a == isc_taskmgrmode_privileged ||
c == isc_taskmgrmode_privileged ||
ATF_CHECK(a == isc_taskmgrmode_privileged &&
c == isc_taskmgrmode_privileged &&
d == isc_taskmgrmode_privileged);
ATF_CHECK(a + c + d == isc_taskmgrmode_privileged);
/* ...and neither of the non-privileged tasks did... */
ATF_CHECK(b == isc_taskmgrmode_normal || e == isc_taskmgrmode_normal);
......
......@@ -598,7 +598,7 @@ isc_taskmgr_renderjson
isc_taskmgr_renderxml
@END LIBXML2
isc_taskmgr_setexcltask
isc_taskmgr_setmode
isc_taskmgr_setprivilegedmode
isc_taskpool_create
isc_taskpool_destroy
isc_taskpool_expand
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment