{
ThreadVars *tv_local = (ThreadVars *)arg;
- /* Set the thread name */
- if (SCSetThreadName(tv_local->name) < 0) {
- SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
- }
+ SCSetThreadName(tv_local->name);
if (tv_local->thread_setup_flags != 0)
TmThreadSetupOptions(tv_local);
{
ThreadVars *tv_local = (ThreadVars *)arg;
- /* Set the thread name */
- if (SCSetThreadName(tv_local->name) < 0) {
- SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
- }
+ SCSetThreadName(tv_local->name);
if (tv_local->thread_setup_flags != 0)
TmThreadSetupOptions(tv_local);
/* initialize the logging subsys */
SCLogInitLogModule(NULL);
- (void)SCSetThreadName("Suricata-Main");
+ SCSetThreadName("Suricata-Main");
/* Ignore SIGUSR2 as early as possble. We redeclare interest
* once we're done launching threads. The goal is to either die
SCLogDebug("Thread name is too long, truncating it..."); \
strlcpy(tname, n, 16); \
pthread_set_name_np(pthread_self(), tname); \
- 0; \
})
#elif defined __OpenBSD__ /* OpenBSD */
/** \todo Add implementation for OpenBSD */
/**
* \brief Set the threads name
*/
-#define SCSetThreadName(n) ({ \
- char tname[THREAD_NAME_LEN + 1] = ""; \
- if (strlen(n) > THREAD_NAME_LEN) \
- SCLogDebug("Thread name is too long, truncating it..."); \
- strlcpy(tname, n, THREAD_NAME_LEN); \
- int ret = 0; \
- if ((ret = prctl(PR_SET_NAME, tname, 0, 0, 0)) < 0) \
- SCLogDebug("Error setting thread name \"%s\": %s", tname, strerror(errno)); \
- ret; \
-})
+#define SCSetThreadName(n) \
+ ({ \
+ char tname[THREAD_NAME_LEN + 1] = ""; \
+ if (strlen(n) > THREAD_NAME_LEN) \
+ SCLogDebug("Thread name is too long, truncating it..."); \
+ strlcpy(tname, n, THREAD_NAME_LEN); \
+ if (prctl(PR_SET_NAME, tname, 0, 0, 0) < 0) \
+ SCLogDebug("Error setting thread name \"%s\": %s", tname, strerror(errno)); \
+ })
#else
#define SCSetThreadName(n) (0)
#endif
TmEcode r = TM_ECODE_OK;
TmSlot *slot = NULL;
- /* Set the thread name */
- if (SCSetThreadName(tv->name) < 0) {
- SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
- }
+ SCSetThreadName(tv->name);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
PacketPoolInit();//Empty();
- /* Set the thread name */
- if (SCSetThreadName(tv->name) < 0) {
- SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
- }
+ SCSetThreadName(tv->name);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);
BUG_ON(s == NULL);
- /* Set the thread name */
- if (SCSetThreadName(tv->name) < 0) {
- SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
- }
+ SCSetThreadName(tv->name);
if (tv->thread_setup_flags != 0)
TmThreadSetupOptions(tv);