From f3da24f7dfbd9692ec9c3dc1706819e8f38e4831 Mon Sep 17 00:00:00 2001 From: sbbs <> Date: Sat, 19 Nov 2016 11:04:15 +0000 Subject: [PATCH] pthread thread names are limited to 15 chars (not including nul terminator) so use shorter thread names. --- src/sbbs3/ftpsrvr.c | 8 ++++---- src/sbbs3/js_global.c | 2 +- src/sbbs3/js_rtpool.c | 2 +- src/sbbs3/mailsrvr.c | 8 ++++---- src/sbbs3/main.cpp | 14 +++++++------- src/sbbs3/sbbscon.c | 2 +- src/sbbs3/services.c | 10 +++++----- src/sbbs3/websrvr.c | 8 ++++---- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c index 3d5a149997..6eb79f5af6 100644 --- a/src/sbbs3/ftpsrvr.c +++ b/src/sbbs3/ftpsrvr.c @@ -1250,7 +1250,7 @@ static void send_thread(void* arg) xfer=*(xfer_t*)arg; free(arg); - SetThreadName("sbbs/FTP Send"); + SetThreadName("sbbs/ftpSend"); thread_up(TRUE /* setuid */); length=flength(xfer.filename); @@ -1510,7 +1510,7 @@ static void receive_thread(void* arg) xfer=*(xfer_t*)arg; free(arg); - SetThreadName("sbbs/FTP Receive"); + SetThreadName("sbbs/ftpReceive"); thread_up(TRUE /* setuid */); if((fp=fopen(xfer.filename,xfer.append ? "ab" : "wb"))==NULL) { @@ -2370,7 +2370,7 @@ static void ctrl_thread(void* arg) #endif login_attempt_t attempted; - SetThreadName("sbbs/FTP Control"); + SetThreadName("sbbs/ftpControl"); thread_up(TRUE /* setuid */); lastactive=time(NULL); @@ -4776,7 +4776,7 @@ void DLLCALL ftp_server(void* arg) ftp_ver(); startup=(ftp_startup_t*)arg; - SetThreadName("sbbs/FTP Server"); + SetThreadName("sbbs/ftpServer"); #ifdef _THREAD_SUID_BROKEN if(thread_suid_broken) diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c index d347c8af29..c4ed9d9e58 100644 --- a/src/sbbs3/js_global.c +++ b/src/sbbs3/js_global.c @@ -123,7 +123,7 @@ static void background_thread(void* arg) jsval result=JSVAL_VOID; jsval exit_code; - SetThreadName("sbbs/JS Background"); + SetThreadName("sbbs/jsBackgrnd"); msgQueueAttach(bg->msg_queue); JS_SetContextThread(bg->cx); JS_BEGINREQUEST(bg->cx); diff --git a/src/sbbs3/js_rtpool.c b/src/sbbs3/js_rtpool.c index e1fdf441e9..42f4aefefa 100644 --- a/src/sbbs3/js_rtpool.c +++ b/src/sbbs3/js_rtpool.c @@ -26,7 +26,7 @@ static link_list_t rt_list; #define TRIGGER_THREAD_STACK_SIZE (256*1024) static void trigger_thread(void *args) { - SetThreadName("sbbs/JSRT Trigger"); + SetThreadName("sbbs/jsRTtrig"); for(;;) { list_node_t *node; pthread_mutex_lock(&jsrt_mutex); diff --git a/src/sbbs3/mailsrvr.c b/src/sbbs3/mailsrvr.c index e916c691c9..37b669604a 100644 --- a/src/sbbs3/mailsrvr.c +++ b/src/sbbs3/mailsrvr.c @@ -826,7 +826,7 @@ static void pop3_thread(void* arg) pop3_t pop3=*(pop3_t*)arg; login_attempt_t attempted; - SetThreadName("sbbs/POP3"); + SetThreadName("sbbs/pop3"); thread_up(TRUE /* setuid */); free(arg); @@ -2498,7 +2498,7 @@ static void smtp_thread(void* arg) ,ENCODING_QUOTED_PRINTABLE } content_encoding = ENCODING_NONE; - SetThreadName("sbbs/SMTP"); + SetThreadName("sbbs/smtp"); thread_up(TRUE /* setuid */); free(arg); @@ -4532,7 +4532,7 @@ static void sendmail_thread(void* arg) BOOL sending_locally=FALSE; link_list_t failed_server_list; - SetThreadName("sbbs/SendMail"); + SetThreadName("sbbs/sendMail"); thread_up(TRUE /* setuid */); terminate_sendmail=FALSE; @@ -5208,7 +5208,7 @@ void DLLCALL mail_server(void* arg) startup->shutdown_now=FALSE; terminate_server=FALSE; - SetThreadName("sbbs/Mail Server"); + SetThreadName("sbbs/mailServer"); protected_uint32_init(&thread_count, 0); do { diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 79988e090d..46b48f7aae 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -1663,7 +1663,7 @@ void input_thread(void *arg) SOCKET high_socket; SOCKET sock; - SetThreadName("sbbs/Terminal Input"); + SetThreadName("sbbs/termInput"); thread_up(TRUE /* setuid */); #ifdef _DEBUG @@ -1934,7 +1934,7 @@ void passthru_output_thread(void* arg) int rd; int wr; - SetThreadName("sbbs/Passthrough Output"); + SetThreadName("sbbs/ptOutput"); thread_up(FALSE /* setuid */); while(sbbs->client_socket!=INVALID_SOCKET && sbbs->passthru_socket!=INVALID_SOCKET && !terminate_server) { @@ -2048,7 +2048,7 @@ void passthru_input_thread(void* arg) BYTE ch; int i; - SetThreadName("sbbs/Passthrough Input"); + SetThreadName("sbbs/ptInput"); thread_up(FALSE /* setuid */); while(sbbs->passthru_socket!=INVALID_SOCKET && !terminate_server) { @@ -2139,7 +2139,7 @@ void output_thread(void* arg) struct timeval tv; ulong mss=IO_THREAD_BUF_SIZE; - SetThreadName("sbbs/Terminal Output"); + SetThreadName("sbbs/termOutput"); thread_up(TRUE /* setuid */); if(sbbs->cfg.node_num) @@ -2379,7 +2379,7 @@ void event_thread(void* arg) sbbs_srand(); /* Seed random number generator */ - SetThreadName("sbbs/Events"); + SetThreadName("sbbs/events"); thread_up(TRUE /* setuid */); #ifdef JAVASCRIPT @@ -4131,7 +4131,7 @@ void node_thread(void* arg) sbbs_t* sbbs = (sbbs_t*) arg; update_clients(); - SetThreadName("sbbs/Terminal Node"); + SetThreadName("sbbs/termNode"); thread_up(TRUE /* setuid */); #ifdef _DEBUG @@ -4632,7 +4632,7 @@ void DLLCALL bbs_thread(void* arg) startup->shutdown_now=FALSE; terminate_server=false; - SetThreadName("sbbs/Terminal Server"); + SetThreadName("sbbs/termServer"); do { /* Setup intelligent defaults */ diff --git a/src/sbbs3/sbbscon.c b/src/sbbs3/sbbscon.c index 04cfdd7241..48f5b5ec23 100644 --- a/src/sbbs3/sbbscon.c +++ b/src/sbbs3/sbbscon.c @@ -1101,7 +1101,7 @@ static void handle_sigs(void) int sig=0; sigset_t sigs; - SetThreadName("sbbs/Signal Handler"); + SetThreadName("sbbs/sigHandler"); thread_up(NULL,TRUE,TRUE); /* Write the standard .pid file if created/open */ diff --git a/src/sbbs3/services.c b/src/sbbs3/services.c index 054d90bd5a..fd2e4368cd 100644 --- a/src/sbbs3/services.c +++ b/src/sbbs3/services.c @@ -979,7 +979,7 @@ static void js_service_thread(void* arg) lprintf(LOG_DEBUG,"%04d %s JavaScript service thread started", socket, service->protocol); - SetThreadName("sbbs/JS Service"); + SetThreadName("sbbs/jsService"); thread_up(TRUE /* setuid */); protected_uint32_adjust(&threads_pending_start, -1); @@ -1182,7 +1182,7 @@ static void js_static_service_thread(void* arg) lprintf(LOG_DEBUG,"%s static JavaScript service thread started", service->protocol); - SetThreadName("sbbs/JS Static Service"); + SetThreadName("sbbs/jsStatic"); thread_up(TRUE /* setuid */); protected_uint32_adjust(&threads_pending_start, -1); @@ -1281,7 +1281,7 @@ static void native_static_service_thread(void* arg) lprintf(LOG_DEBUG,"%04d %s static service thread started", inst.socket, inst.service->protocol); - SetThreadName("sbbs/Static Service"); + SetThreadName("sbbs/static"); thread_up(TRUE /* setuid */); protected_uint32_adjust(&threads_pending_start, -1); @@ -1344,7 +1344,7 @@ static void native_service_thread(void* arg) lprintf(LOG_DEBUG,"%04d %s service thread started", socket, service->protocol); - SetThreadName("sbbs/Native Service"); + SetThreadName("sbbs/native"); thread_up(TRUE /* setuid */); protected_uint32_adjust(&threads_pending_start, -1); @@ -1734,7 +1734,7 @@ void DLLCALL services_thread(void* arg) startup->recycle_now=FALSE; startup->shutdown_now=FALSE; - SetThreadName("sbbs/Services"); + SetThreadName("sbbs/services"); do { /* Setup intelligent defaults */ diff --git a/src/sbbs3/websrvr.c b/src/sbbs3/websrvr.c index 90d4b448ea..70af08738d 100644 --- a/src/sbbs3/websrvr.c +++ b/src/sbbs3/websrvr.c @@ -6009,7 +6009,7 @@ void http_output_thread(void *arg) int i; unsigned mss=OUTBUF_LEN; - SetThreadName("sbbs/HTTP Output"); + SetThreadName("sbbs/httpOutput"); thread_up(TRUE /* setuid */); obuf=&(session->outbuf); @@ -6145,7 +6145,7 @@ void http_session_thread(void* arg) char *uname; #endif - SetThreadName("sbbs/HTTP Session"); + SetThreadName("sbbs/httpSess"); pthread_mutex_lock(&((http_session_t*)arg)->struct_filled); pthread_mutex_unlock(&((http_session_t*)arg)->struct_filled); pthread_mutex_destroy(&((http_session_t*)arg)->struct_filled); @@ -6511,7 +6511,7 @@ void http_logging_thread(void* arg) if(!base[0]) SAFEPRINTF(base,"%slogs/http-",scfg.logs_dir); - SetThreadName("sbbs/HTTP Logging"); + SetThreadName("sbbs/httpLog"); filename[0]=0; newfilename[0]=0; @@ -6625,7 +6625,7 @@ void DLLCALL web_server(void* arg) startup=(web_startup_t*)arg; - SetThreadName("sbbs/Web Server"); + SetThreadName("sbbs/webServer"); web_ver(); /* get CVS revision */ if(startup==NULL) { -- GitLab