affinity: drop capability after setting thread prio

Setting thread priority can require privilege if a low nice value
has to be set up.
pull/54/merge
Eric Leblond 13 years ago committed by Victor Julien
parent d1569337a7
commit 073b251df7

@ -146,12 +146,12 @@ void *TmThreadsSlot1NoIn(void *td)
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
}
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (s->SlotThreadInit != NULL) {
void *slot_data = NULL;
r = s->SlotThreadInit(tv, s->slot_initdata, &slot_data);
@ -245,12 +245,12 @@ void *TmThreadsSlot1NoOut(void *td)
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
}
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (s->SlotThreadInit != NULL) {
void *slot_data = NULL;
r = s->SlotThreadInit(tv, s->slot_initdata, &slot_data);
@ -325,12 +325,12 @@ void *TmThreadsSlot1NoInOut(void *td)
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
}
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
/* Drop the capabilities for this thread */
SCDropCaps(tv);
SCLogDebug("%s starting", tv->name);
if (s->SlotThreadInit != NULL) {
@ -402,12 +402,12 @@ void *TmThreadsSlot1(void *td)
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
}
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
/* Drop the capabilities for this thread */
SCDropCaps(tv);
SCLogDebug("%s starting", tv->name);
if (s->SlotThreadInit != NULL) {
@ -609,12 +609,12 @@ void *TmThreadsSlotPktAcqLoop(void *td) {
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
}
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
/* Drop the capabilities for this thread */
SCDropCaps(tv);
/* check if we are setup properly */
if (s == NULL || s->PktAcqLoop == NULL || tv->tmqh_in == NULL || tv->tmqh_out == NULL) {
SCLogError(SC_ERR_FATAL, "TmSlot or ThreadVars badly setup: s=%p,"
@ -702,12 +702,12 @@ void *TmThreadsSlotVar(void *td)
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
}
/* Drop the capabilities for this thread */
SCDropCaps(tv);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
/* Drop the capabilities for this thread */
SCDropCaps(tv);
/* check if we are setup properly */
if (s == NULL || tv->tmqh_in == NULL || tv->tmqh_out == NULL) {
EngineKill();

Loading…
Cancel
Save